|
From: Jeff D. <jd...@ka...> - 2000-03-12 03:44:03
|
> [wstearns@sparrow uml]$ touch vm_file
> [wstearns@sparrow uml]$ ./linux-2.3.49 devfs=nomount
> open: File exists
The one thing that's important about vm_file is that it not exist beforehand.
That's the file that holds the kernel's physical memory. It is opened (and
created) and then unlinked.
What seems to be the problem is that your /dev/ttyp* files aren't usable by
anyone besides root. Loosening up protections would help a lot. Mine look
like this:
crw-rw-rw- 1 root tty 3, 0 May 5 1998 /dev/ttyp0
Which reminds me that I'd better switch everything over to use /dev/pts
sometime...
Those diffs are innocuous. Here's what they mean:
> -fstat(4, {st_mode=S_IFREG|0775, st_size=16777217, ...}) = 0
> -mprotect(0x100c8000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
> +fstat(4, {st_mode=S_IFREG|0755, st_size=16777217, ...}) = 0
> +mprotect(0x100d6000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC) = 0
I don't know what the fstat is doing. The mprotect is changing the
permissions on the two pages containing init_task so that they are suitable
for use as a stack. The address is different because init_task is in the
executable and it changed size from .49 to .51.
> -rt_sigaction(SIGUSR1, {0x100779dc, [], SA_RESTART}, {SIG_DFL}, 8) = 0
> -rt_sigaction(SIGIO, {0x100778b8, [], SA_RESTART}, {SIG_DFL}, 8) = 0
> -select(1, [], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be
> restarted)
> ---- SIGUSR1 (User defined signal 1) ---
> -kill(5671, SIGUSR1) = 0
> -sigreturn() = ? (mask now [])
> -select(2, [0], NULL, NULL, NULL) = ? ERESTARTNOHAND (To be restarted)
> -+++ killed by SIGKILL +++
> +pipe([7, 8]) = 0
> +fn=0x411, child_stack=0x50001ff4, flags=0x7, args=0x1000000clone()
> = 6429
> +rt_sigaction(SIGIO, {0x10084688, [], SA_RESTART}, {SIG_DFL}, 8) = 0
> +select(9, [7], NULL, NULL, NULL) = 1 (in [7])
> +read(7, "\2\0\0\0\0\0\0\0\210\264\10\20\4\0\0\0\277\0\0\0000\n\0"...,
> 140) = 140
> +select(9, [0 7], NULL, NULL, NULL
I don't know what the SIGIO stuff is about here, but the rest of it is my
redoing the mechanism by which other threads make requests of the input thread.
Its main job is to select on file descriptors that are important to the rest
of the kernel and let it know when input has arrived. Since it has the only
user stack in the whole kernel and is the only thread that can call fork, I
also gave it the job of firing off xterms for the virtual consoles.
I used to give it jobs by sending it a SIGUSR1 (hence the SIGUSR1
disappearing) and have it figure out what's going on by having it read some
global data. Now it makes a pipe, listens on the read end, and any thread
that needs something asks nicely on the write end. This automatically
serializes the requests and eliminates the need for the locking I was doing
before.
The trace above is catching the input thread in the act of getting a request
from the console to select on stdin (the read end of the pipe is fd 7, which
gets input, and as a result of that input, the next select has fd 0 added to
the read mask).
Jeff
|