Access hardware registers with PB ?

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Andre.

A german guy (developing floppy-controllers) asked me, if its possible to access hardware registers with PureBasic under the three different PB versions. As there isn't a command included, does someone know a solution/example under Windows, Linux, Amiga ? Thanks in advance :)

Regards
André

*** German PureBasic Support ***
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

Hi Andre,

Can't imagine he is developing a floppy controller that fit's Amiga and PC :)
Check this to do it under windows NT-2K-XP, he needs to write a dedicated devicedriver or use WinIO or similar driver.
viewtopic.php?t=2549">http://forums.pur ... ebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

Linux and AmigaOS are ok (nothing is protected on AmigaOS BTW)

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

fred: how can you access a hardware port directly in
a secure _protected mode_ operating system like Linux?
In a secure OS this is never allowed because it could
crash the hardware.
For example: When 3 apps access a port at the same time,
things can mix up in a very bad way.
Thats the reason you have to use device drivers for
everything. The device driver manages the access requests
from different apps, so nothing gets mixed up.

So you say that Linux is competely unsecured in this way ??
Really ??

cya,
...Danilo
(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

I never said it's unsecured, there is some API which let you access the hardware registers of all devices, that's all.

Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

True, i used linux hardware monitor PDF's to get information i use in RAIDmonitor on windows.
The functions to access PCI Config Space etc.. are build in.

Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Danilo.

Sorry Fred, got that wrong.

Andre asked for help and you just answered
"Linux and AmigaOS are ok", so i thought
only little ASM OUT and no extra stuff
is needed here (couldnt believe that).

Why not tell us how to access it on Linux and Amiga? :)

cya,
...Danilo
(registered PureBasic user)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

On Amiga, you can poke it directly (I've already done it with custom chips... who called Paula ? :)). On linux, you have to have root access, and then open the device (/dev/xxxx) with standard file command. ioctrl() can be used to perform special op, which are of course filtered and computed by the device driver.



Fred - AlphaSND
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Andre.

Thanks guys for your answers. Hope the informations can help a bit :)
@Berikco: yes, its the developer of the Catweasel MK 3

Regards
André

*** German PureBasic Support ***
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.
Originally posted by Andre
@Berikco: yes, its the developer of the Catweasel MK 3
Never heard of this animal, Catweasel?? :)

Regards,

Berikco

http://www.benny.zeb.be/purebasic.htm
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Seldon.

Mmm... I guess he is developing a driver for the Catweasel controller, right? Well.. to access hardware registers in Win9x... you need to develop a .vxd (since it works in ring-0 mode with no protection). In WinNT/2000/XP, I think there are devices to access physical resources.
Post Reply