Hardware assembly

John john at starfire.mn.org
Sat Jan 15 19:38:11 PST 2005

On Sun, Jan 16, 2005 at 03:28:18AM +0000, Street Chaman wrote:
> hi everyone,
> i need low level hardware control over some devices (kbd, sound, display) in 
> an assembly soft, and 'd like to know where i can find a list of 
> ioctl_syscall supported parameters for each device.
> Furthermore, if someone knows some good (more complete than 
> developpers-handbook) gas doc/sources, it would be a great help for me.

Well, Street, some may call this cheating, but it is probably worth
your while to try it this way.

Create empty routines in C to get your calling sequences down, then
use the compiler to create the linkages for you (see the -S option).
Then you can concentrate on your functionality, rather than trying
to do the stack work that you need.  If you are actually making
ioctl or syscalls, then write the C for the ioctl into your framework
and, again, let the compiler generate the linkages.  If you actually
want to make the syscalls directly, you should dig out the assembler
source from the system sources of the libraries and use them as a
template - just beware, the syscalls can CHANGE, which is one reason
we always rebuild the "world" with the kernel.  Part of the reason
for using the standard libraries is to put a layer of abstraction
between you and the basic OS calling sequence.

Just my $0.02.

John Lind
john at starfire.MN.ORG

More information about the freebsd-questions mailing list