Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#4777 - 20/02/2000 03:44 Info about /sbin/init
kim
member

Registered: 21/07/1999
Posts: 140
Loc: Helsinki, Finland
Any chance of getting the source code of /sbin/init or atleast some information of what it does?

I've been trying to create an own bootloader which lets you to choose what program you want to run - so that running custom programs without being on console would be possible.

I've been playing with /sbin/init and I can run simple programs in it but since the drives are not mounted yet, I have trouble loading files from other directories, etc.

All I would need to know is how it mounts the drives in beginning and what other init code it executes before it launches /empeg/bin/player. Also as it has some mechanism of remounting partitions and switching to shell-player loop when you press 'q' from the player, it would be nice to have a proper init that does also the same kind of things (to ensure that drives are always in safe state, etc).

Kim


Top
#4778 - 20/02/2000 12:48 Re: Info about /sbin/init [Re: kim]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
From memory, what it does (very very basically) is:

#!/bin/sh
mount -n /proc
mount -n /dev/hda4 /drive0
mount -n /dev/hdc4 /drive1
exec /empeg/bin/player

...it does more, but this is more to do with recovery & starting shells afterwards (& so on). Take the above and add your menu code afterwards and most things should be ok (I think!)

Hugo



Top
#4779 - 21/02/2000 03:39 Re: Info about /sbin/init [Re: altman]
kim
member

Registered: 21/07/1999
Posts: 140
Loc: Helsinki, Finland
From memory, what it does (very very basically) is:

#!/bin/sh
mount -n /proc
mount -n /dev/hda4 /drive0
mount -n /dev/hdc4 /drive1
exec /empeg/bin/player

...it does more, but this is more to do with recovery & starting shells afterwards (& so on). Take the above and add your menu code afterwards and most things should be ok (I think!)


OK, I tried this:

#!/bin/sh
echo *** Mounting /proc ***
mount -n /proc
echo *** Mounting /drive0 ***
mount -n /dev/hda4 /drive0
echo *** Mounting /drive1 ***
mount -n /dev/hdc4 /drive1
echo *** Executing player ***
exec /empeg/bin/player


But no luck. The player reports that it has been started but then it just seem to hang there. With my own program, it was infinitely giving permission faults or something. Also, those mount commands took quite a while to execute so it probably was mounting them rw even though ro would have been enough.

See the attached log for more details.


Top
#4780 - 21/02/2000 12:09 Re: Info about /sbin/init [Re: kim]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
Erk, yes, "mount -n -ro -o nocheck" is more like it.

You won't be able to run anything after an exec: this replaces the /bin/sh script with the player. If you want the script to continue after this point, make it an "/empeg/bin/player &".

Hugo



Top