Re: /sbin/init



On Wed, 22 Nov 2006 12:30:28 +0100 Pascal Bourguignon <pjb@xxxxxxxxxxxxxxxxx> wrote:

| Perianayagam Somasundaram <somu@xxxxxxxxxxxxxx> writes:
|> Does anybody have an idea how to make /sbin/init print out
|> debug messages?
|
| /sbin/init has no bug.
|
| Otherwise, /sbin/init is run from the kernel, and without a terminal
| (perhaps it's stdout and stderr are hooked to the console?).
|
| From within the sources of init, you could open a file and dup it to
| the stdout and stderr to write messages to this file, or to the
| console if it is not already done. But the question is what file?
| When init is run, no file system has been mounted yet (but of course
| the root file system where /sbin/init is, but it may be mounted
| read-only). And no service, like syslog is running yet either.
|
| Otherwise you'll have to modify the kernel.

It might be possible to use the "qemu" emulator in per-process emulation
mode to run the init program, and turn on debugging. Unlike strace,
which would run the target program in another process (and it wouldn't
be process ID 1 as needed), what qemu does is emulate within the same
process. In the per-process emulation, it just runs a program instead
of a whole system, so all the kernel syscalls would have to go to the
real host system from the emulator. If it's running in PID 1, it _may_
work. I've never tried this. I never even thought of it before I just
saw this thread. But it has piqued my interest. Maybe I'll give it a
try later on.

--
|---------------------------------------/----------------------------------|
| Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
| first name lower case at ipal.net / spamtrap-2006-11-22-1856@xxxxxxxx |
|------------------------------------/-------------------------------------|
.



Relevant Pages

  • Re: How to debug kernel ?
    ... which is what you have in the Windows Mobile emulators. ... Yes, you might be able to catch debug messages from an emulator, if you ... What happens when you try to launch the application? ...
    (microsoft.public.windowsce.platbuilder)
  • Re: How to debug kernel ?
    ... Yes, you might be able to catch debug messages from an emulator, if you built the emulator! ... However, it would be more-useful, I think, to address the *actual problem* (your application won't launch), rather than going off into building a whole new OS so you can get debug messages. ... Actually I have compiled with cegcc a simple sample application that loads a Dll and I get an error message when launching on Windows Mobile 6.1. ...
    (microsoft.public.windowsce.platbuilder)
  • Re: writeXML(fullFilePath) DOESNT Write
    ... You can not read files into the dataset from local hard drive. ... Emulator's file system is independent from desktop's file system and ... drive onto emulator file system; they are copied into it on deployment. ... You have to use emulator's file explorer to check emulator's file system, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: writeXML(fullFilePath) DOESNT Write
    ... Are you saying that because I put the XML file into my project directory as content, it's being copied to the emulator and then being read from there? ... > Emulator's file system is independent from desktop's file system and ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: How to debug kernel ?
    ... Yes, you might be able to catch debug messages from an emulator, if you ... the *actual problem* (your application won't launch), ... I have downloaded PB6 and I would like to understand why my application ...
    (microsoft.public.windowsce.platbuilder)