Funny you should ask; I just finished a project and a paper on
precisely that subject. We used a 1Mb resident flash array to boot a
kernel and initrd image and then ran a demo RT-Linux program. The
following required ~900k on the dos RFA partition (including the space
dos took up), and uncompressed to around 2Mb in memory. It should get
you started:
/bin:
-rwxr-xr-x 1 root root 75020 May 13 13:18 gkiss
lrwxrwxrwx 1 root root 5 May 13 13:19 sh -> gkiss
/dev:
lrwxrwxrwx 1 root root 4 May 13 13:25 console -> tty0
brw-rw---- 1 root disk 3, 0 Feb 22 22:41 hda
brw-rw---- 1 root disk 3, 1 Feb 22 22:41 hda1
…
brw-rw---- 1 root disk 3, 9 Feb 22 22:41 hda9
brw-rw---- 1 root disk 1, 250 Feb 22 22:42 initrd
crw-r----- 1 root kmem 1, 2 Feb 22 22:41 kmem
crw-r----- 1 root kmem 1, 1 Feb 22 22:41 mem
crw-rw-rw- 1 root root 1, 3 Feb 22 22:41 null
lrwxrwxrwx 1 root root 4 May 13 13:25 ram -> ram1
brw-rw---- 1 root disk 1, 0 Feb 22 22:41 ram0
brw-rw---- 1 root disk 1, 1 Feb 22 22:41 ram1
…
brw-rw---- 1 root disk 1, 16 Feb 22 22:41 ram16
crw-rw-rw- 1 root tty 5, 0 Feb 22 22:41 tty
crw--w--w- 1 root root 4, 0 May 13 13:10 tty0
…
crw-rw-rw- 1 root tty 4, 9 Feb 22 22:42 tty9
crw-rw-rw- 1 root root 1, 5 Feb 22 22:41 zero
/etc:
-rw-r--r-- 1 root root 10034 May 13 13:24 ld.so.cache
-rw-r--r-- 1 root root 76 May 13 13:24 ld.so.conf
/lib:
-rwxr-xr-x 1 root root 45017 Feb 21 00:37 ld-2.0.7.so
lrwxrwxrwx 1 root root 11 May 13 13:24 ld-linux.so.2
-> ld-2.0.7.so
-rw-r--r-- 1 root root 651436 Feb 21 00:37 libc-2.0.7.so
lrwxrwxrwx 1 root root 13 May 13 13:22 libc.so.6
->
libc-2.0.7.so
/sbin:
-rwxr-xr-x 1 root root 30632 Jan 30 12:04 insmod
lrwxrwxrwx 1 root root 6 May 13 13:20 rmmod -> insmod
For our shell, we used kiss (gkiss is the getline version), which is
only 70k and includes a BUNCH of trimmed version programs: ls, cat,
more, mount, ln, rm, etc. compiled into the shell itself, so you don't
have to add the full versions into /bin. Kiss reads /etc/kiss.rc for its
system wide shell startup script, and $HOME/kiss.rc for its user script.
You can customize it that way (and probly even use it to launch your
RT-Linux prog). It initally complains about not finding the current
user, which is fine since our little file system is missing things like
libcrypt and an /etc/passwd file. I'm pretty sure you can remove this
error by customizing the prompt to not include a username (i.e. root) at
the beginning.
The /dev directory should have at least console, tty[n], kmem and mem,
null, ram[n], and you can pretty much add whatever devices you need from
there.
The /etc directory should contain at least ld.so.cache, which contains
information on where the local library files are stored (afaik).
For libraries, at least ld-linux.so.2 and libc.so.6 for libc 6, or
ld-linux.so.1 and libc.so.5 for libc 5. To find out what libraries a
binary executable uses, use the ldd command: "ldd binfile".
To add an RT-Linux program: throw the rtlinux modules into /lib/modules
directory, and make sure to copy over rtfifo devices from /dev. Put your
program wherever; /usr/src is convenient. Then use insmod (by hand or
shell script) to install the various modules. Note that lsmod needs a
/proc filesystem to work, which the above does not provide.
To create a ramdisk image:
dd if=/dev/zero of=initrd.img bs=2b count=1024
losetup /dev/loop0 initrd.img
mkfs /dev/loop0
mount /dev/loop0 /mnt
o Make the directory structure using mkdir
o Copy over binary and device files using "cp -a"
umount /mnt
losetup -d /dev/loop0
gzip < initrd.img > initrd
Copy this along with loadlin.exe and vmlinuz to your dos partition, and
load it with the following command:
loadlin vmlinuz root=/dev/ram rw initrd=initrd
For a LILO boot, you'll need a /boot directory. The LILO documentation
will give you plenty of information on setting things up. Another good
source of information is the Bootdisk-HOWTO. Hope this helps...
Robert & Patricia Warner wrote:
>
> Hi,
>
> I'm attempting to install RT-Linux on an M-System (www.m-sys.com) DOC
> (Disk On Chip) . I have a 2 MB and 16 MB version of this chip. I've
> recomplied the 2.0.36 kernel to the minimum that I require, 300KB. Plus > I'll need
>a loader probably LILO or direct boot, if possible.
>
> My quesion is, what is the minimum file system required by Linux after
> booting? If this is to broad of a question is there a list of the
> minimum files need for operation, again possibly to broad? I plan on
> makeing part of the file system in a RAM disk, if possible, to minimize > over use
>of the flash file system.
>
> Any thoughts or concerns would be appriciated.
>
> Thanks
> Bob Warner
--- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
----
For more information on Real-Time Linux see:
http://www.rtlinux.org/~rtlinux/