Using sysarch specific syscalls in assembly?

alexander arundel at h3c.de
Thu Aug 11 12:01:09 GMT 2005


On Wed Aug 10 05, Daan Vreeken [PA4DAN] wrote:
> 
> I can confirm that. I have tested the program on 5.4-RELEASE here. Testing 
> your program (I called it "p") 10 times gives the following output :
> 
> root at Racebeest# for a in 0 1 2 3 4 5 6 7 8 9;do echo "starting p"; ./p ;done
> starting p
> starting p
> starting p
> Bus error (core dumped)
> starting p
> Bus error (core dumped)
> starting p
> starting p
> starting p
> Bus error (core dumped)
> starting p
> Bus error (core dumped)
> starting p
> starting p
> root at Racebeest# 
> 
> However, opening /dev/io to gain IO privileges instead of using sysarch always 
> works. I tested that with the following program :
> 
> #include <fcntl.h>
> 
> static inline void outb (unsigned short int port, unsigned char val) {
>         __asm__ volatile ("outb %0,%1\n"::"a" (val), "d" (port) );
> }
> 
> int main (void) {
> 
>         if (open("/dev/io", O_RDONLY) == -1) {
>                 printf("EEK!\n");
>                 exit(1);
>         }
> 
>         outb(0x378, 0xff);
> }
> 
> --- EOF ---
> 
> grtz,
> Daan

Hmm...very odd. Should I file a bug report about this problem?


More information about the freebsd-hackers mailing list