[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few technical questions





n

On Mon, 7 Jul 1997, Shlomi Fish wrote:

> This is a plethura of technical questions I want to ask about Linux:
> 
> 1. I remember that on SCO, one cannot call the inb/outp/inw/outw assembler
> system calls when writing normal programs. Such stuff may only be done
> within the kernel. Does the same prohibition exists on Linux and if so, is
> it possible to write a kernel general device driver to do port I/O? I mean
> that I can enable I/O to various ports in the kernel and then I'll be able
> to wrap the calls by calling a "my_output_byte_to_port(0x200, '\0')" rather
> than "asm { outb 200h, 0 }" ?

There is a ioperm (2) syscall , you must be a root to open the ports to 
reading/writing to simple user. After this you could use syscall/asm - 
but AIK cc/gcc translate asm port commands to syscalls.

> 
> 3. I was still unable to write a simple multi-threaded program with the
> clone() system call. Not only does "#include <asm/unistd.h>" causes many
> errors, but after I fix them by defining a macro before the include, the
> call seems to do the same thing as a regular fork(). I also noticed that
> its two parameters are appearently in the opposite order than what is
> documented in the manual page, but reversing them won't help either. I've
> tried to run it even without X but to no avail.

There is the simplier way to use threads in linux - Posix Threads or
Linux Threads library.I don't knew any site to download them, but it is
trivial to find.

P.S. RH4.1 is going with Linux Threads


Follow-Ups: References: