Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Aug 2005 14:01:08 +0200
From:      alexander <arundel@h3c.de>
To:        freebsd-hackers@freebsd.org
Subject:   Re: Using sysarch specific syscalls in assembly?
Message-ID:  <20050811120108.GA20415@skatecity>
In-Reply-To: <200508102019.15147.Danovitsch@Vitsch.net>
References:  <20050809133109.GA15300@skatecity> <20050809192530.GA19230@skatecity> <20050810130928.GA2027@skatecity> <200508102019.15147.Danovitsch@Vitsch.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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@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@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?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050811120108.GA20415>