linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Can I run linux without a file system?
@ 2002-06-21 15:08 Tim Lai
  2002-06-21 19:54 ` Wolfgang Denk
  0 siblings, 1 reply; 27+ messages in thread
From: Tim Lai @ 2002-06-21 15:08 UTC (permalink / raw)
  To: linuxppc-embedded


I am porting linux on a custom board.
I am using the bootrom to load vmlinux onto
RAM, and I am in the middle of getting the console/
serial driver to work.
All the documents I read have refer the console as
/dev/ttyS, and state that to communicate to the
console, I have to set it up with open("/dev/ttyS").

Does that means I have to have some sort of file
system in linux?

Thanks.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: Can I run Linux without a file system?
@ 2002-06-21 19:22 Hihn Jason
  2002-06-21 19:35 ` Tim Lai
  0 siblings, 1 reply; 27+ messages in thread
From: Hihn Jason @ 2002-06-21 19:22 UTC (permalink / raw)
  To: 'Tim Lai', linuxppc-embedded


There are people here who can help you more than I, but I'll take a gander.
This is what I believe to be correct:
Yes. You will always have SOME kind of filesystem. But this begs another
question. How much do you know about Linux, and what are you really asking?
The /proc filesystem is not really on any disk, just like /dev (I think)
isn't on any disk, though they look like to us users that they are
filesystems.

If you want to run a program, where will it come from? There are filesystems
made for RAM, like cramfs or ramdisks, or flash filesystems complete with
wear-leveling. Maybe you can just jump to an offset and start executing code
if all you have is just a kernel and a program. If that is the case then
maybe you'll have to call your program 'init' or change the source of the
kernel to invoke your program.

Does this help?

I reserve the right to be wrong.


-----Original Message-----
From: Tim Lai [mailto:laitingwai@yahoo.com]
Sent: Friday, June 21, 2002 11:09 AM
To: linuxppc-embedded@lists.linuxppc.org
Subject: Can I run linux without a file system?



I am porting linux on a custom board.
I am using the bootrom to load vmlinux onto
RAM, and I am in the middle of getting the console/
serial driver to work.
All the documents I read have refer the console as
/dev/ttyS, and state that to communicate to the
console, I have to set it up with open("/dev/ttyS").

Does that means I have to have some sort of file
system in linux?

Thanks.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: Can I run Linux without a file system?
  2002-06-21 19:22 Can I run Linux without a file system? Hihn Jason
@ 2002-06-21 19:35 ` Tim Lai
  2002-06-21 19:46   ` Re[2]: " Ricardo Scop
  2002-06-21 19:50   ` Dan Malek
  0 siblings, 2 replies; 27+ messages in thread
From: Tim Lai @ 2002-06-21 19:35 UTC (permalink / raw)
  To: linuxppc-embedded


Thanks, Jason.
I am new to linux kernel. I'll have the main
application run from init(), so I wasn't planning
to have a file system.

> Yes. You will always have SOME kind of filesystem.
> But this begs another
> question. How much do you know about Linux, and what
> are you really asking?

If /proc and /dev is not really on any disk, what do
I have to do to init or create /dev? Do I need ramdisk
as a minumum requirement for linux?
My main goal right now is to get the serial port
to work, so I can do some debugging with the dumb
terminal. After I do tty_register() in the serial
driver, does linux assign /dev/ttyS to this device?

> The /proc filesystem is not really on any disk, just
> like /dev (I think)
> isn't on any disk, though they look like to us users
> that they are
> filesystems.
>

Can you give me pointers on which file to read?

>
> Does this help?
>

Yes. Thank you very much. :)


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
       [not found] <200206211835.g5LIZDL01282@hofr.at>
@ 2002-06-21 19:42 ` Tim Lai
  2002-06-21 20:12   ` Jerry Van Baren
  0 siblings, 1 reply; 27+ messages in thread
From: Tim Lai @ 2002-06-21 19:42 UTC (permalink / raw)
  To: linuxppc-embedded


I am interested in both input/output operation
on the console. If I just set CONFIG_SERIAL_CONSOLE,
will I be able read input from the console?
The main application will be started from init(),
and the application will need to read and write
to the console. Are there are method to communicate
to the serial port other than open("/dev/ttyS0")?


>
> You don't need a filesystem to get output on the
> serial console
> you just need to enable the console with
> CONFIG_SERIAL_CONSOLE=y
> in your kernel configuration (atleast for mpc860
> that all)
> but you will have a hard time producing much more
> than a blinking
> cursor if you boot a Linux kernel and have no
> application that
> it then can run on the root-filesystem - what would
> be the point
> of such a setup - 1MB kernel code for a blinking
> cursor on a
> serial port seems expensive.
>
> hofrat


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re[2]: Can I run Linux without a file system?
  2002-06-21 19:35 ` Tim Lai
@ 2002-06-21 19:46   ` Ricardo Scop
  2002-06-21 19:50   ` Dan Malek
  1 sibling, 0 replies; 27+ messages in thread
From: Ricardo Scop @ 2002-06-21 19:46 UTC (permalink / raw)
  To: Tim Lai; +Cc: linuxppc-embedded


Tim,

Maybe initrd and linuxrc is enough for your system. Read the file
initrd.txt in the Linux source tree Documentation sub-directory.

[]'s, Scop                            mailto:scop@vanet.com.br

------------------------------------------------------------------
It might look like I'm doing nothing, but at the cellular level I'm
really quite busy.

Friday, June 21, 2002, 4:35:17 PM, you wrote:


TL> Thanks, Jason.
TL> I am new to linux kernel. I'll have the main
TL> application run from init(), so I wasn't planning
TL> to have a file system.

>> Yes. You will always have SOME kind of filesystem.
>> But this begs another
>> question. How much do you know about Linux, and what
>> are you really asking?

TL> If /proc and /dev is not really on any disk, what do
TL> I have to do to init or create /dev? Do I need ramdisk
TL> as a minumum requirement for linux?
TL> My main goal right now is to get the serial port
TL> to work, so I can do some debugging with the dumb
TL> terminal. After I do tty_register() in the serial
TL> driver, does linux assign /dev/ttyS to this device?

>> The /proc filesystem is not really on any disk, just
>> like /dev (I think)
>> isn't on any disk, though they look like to us users
>> that they are
>> filesystems.
>>

TL> Can you give me pointers on which file to read?

>>
>> Does this help?
>>

TL> Yes. Thank you very much. :)

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run Linux without a file system?
  2002-06-21 19:35 ` Tim Lai
  2002-06-21 19:46   ` Re[2]: " Ricardo Scop
@ 2002-06-21 19:50   ` Dan Malek
  2002-06-21 20:18     ` Tim Lai
  1 sibling, 1 reply; 27+ messages in thread
From: Dan Malek @ 2002-06-21 19:50 UTC (permalink / raw)
  To: Tim Lai; +Cc: linuxppc-embedded


Tim Lai wrote:

> I am new to linux kernel. I'll have the main
> application run from init(), so I wasn't planning
> to have a file system.

So, why are you trying to use Linux?  If you don't start
up applications outside of the kernel, there aren't very
many features that make it attractive or useful.


	-- Dan


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 15:08 Tim Lai
@ 2002-06-21 19:54 ` Wolfgang Denk
  0 siblings, 0 replies; 27+ messages in thread
From: Wolfgang Denk @ 2002-06-21 19:54 UTC (permalink / raw)
  To: Tim Lai; +Cc: linuxppc-embedded


In message <20020621150853.2021.qmail@web21104.mail.yahoo.com> you wrote:
>
> Does that means I have to have some sort of file
> system in linux?

Yes. Things like root directory, working directory, device files, ...
are essential concepts of Unix; you  cannot  get  rid  of  them  that
easily - nor is there any reason to do so.

One day you will probably want to run some application -  where  will
you put it?

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
"Language shapes the way we think, and determines what we  can  think
about."                                                 - B. L. Whorf

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 19:42 ` Tim Lai
@ 2002-06-21 20:12   ` Jerry Van Baren
  2002-06-21 20:28     ` Tim Lai
  2002-06-21 20:31     ` Dr. Craig Hollabaugh
  0 siblings, 2 replies; 27+ messages in thread
From: Jerry Van Baren @ 2002-06-21 20:12 UTC (permalink / raw)
  To: linuxppc-embedded


You need at least a RAM file system for "/" and a bunch of subdirectories
such as /dev, /lib, etc.  The common way to do this on a minimalistic
system is to create a file system image in ROM (often compressed) and copy
it to RAM on start up.  Given the questions you are asking, I am very
confident creating a minimal RAM disk image will challenge you sufficiently
:-).  I'm not being snide, lots of people with lots of linux knowledge have
tried and failed.  Most people use someone else's pre-configured minimal
file systems and add/subtract (mostly add :-) programs to it.  This is
because it is very, very hard to create a minimal file system (that works,
that is).

Pointers to development systems with example RAM disk images:
   http://www.denx.de/solutions-en.html
     ftp://ftp.denx.de/pub/LinuxPPC/usr/src/SELF/
   http://www.mvista.com/
   (there are others, I'm just too lazy to do the google search for you)

Trying to run linux without a file system of any sort would require you to
rewrite of pretty much everything and the three or four things you didn't
rewrite, you would have to rebuild (static link, no shared
libraries).  There are a lot of software engineers and hackers that would
turn down the opportunity to do this at any price.  On the other hand, a
lot of naivety and a even more coffee sometimes generates remarkable
results :-).

You really want to look at eCOS or one of the other light weight tasking OSs.
   http://www.redhat.com/embedded/technologies/ecos/

gvb


At 12:42 PM 6/21/2002 -0700, Tim Lai wrote:

>I am interested in both input/output operation
>on the console. If I just set CONFIG_SERIAL_CONSOLE,
>will I be able read input from the console?
>The main application will be started from init(),
>and the application will need to read and write
>to the console. Are there are method to communicate
>to the serial port other than open("/dev/ttyS0")?
>
>
> >
> > You don't need a filesystem to get output on the
> > serial console
> > you just need to enable the console with
> > CONFIG_SERIAL_CONSOLE=y
> > in your kernel configuration (atleast for mpc860
> > that all)
> > but you will have a hard time producing much more
> > than a blinking
> > cursor if you boot a Linux kernel and have no
> > application that
> > it then can run on the root-filesystem - what would
> > be the point
> > of such a setup - 1MB kernel code for a blinking
> > cursor on a
> > serial port seems expensive.
> >
> > hofrat
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run Linux without a file system?
  2002-06-21 19:50   ` Dan Malek
@ 2002-06-21 20:18     ` Tim Lai
  0 siblings, 0 replies; 27+ messages in thread
From: Tim Lai @ 2002-06-21 20:18 UTC (permalink / raw)
  To: linuxppc-embedded; +Cc: linuxppc-embedded


Well, there is memory protection for now.
And when new hardware arrives, we'll have
file system.

--- Dan Malek <dan@embeddededge.com> wrote:
>
> Tim Lai wrote:
>
> > I am new to linux kernel. I'll have the main
> > application run from init(), so I wasn't planning
> > to have a file system.
>
> So, why are you trying to use Linux?  If you don't
> start
> up applications outside of the kernel, there aren't
> very
> many features that make it attractive or useful.
>
>
> 	-- Dan
>
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:12   ` Jerry Van Baren
@ 2002-06-21 20:28     ` Tim Lai
  2002-06-21 20:31     ` Dr. Craig Hollabaugh
  1 sibling, 0 replies; 27+ messages in thread
From: Tim Lai @ 2002-06-21 20:28 UTC (permalink / raw)
  To: Jerry Van Baren, linuxppc-embedded


Thanks for all the replies. After reading all the
helpful response. I think I will try to use initrd,
and probably try ramdisk, too. I don't necessary need
to run with a minimum system. The hardware has 8M,
and I will try 1M for ramdisk. It seems like this
is the easiest way to get thing starts.


--- Jerry Van Baren <vanbaren_gerald@si.com> wrote:
>
> You need at least a RAM file system for "/" and a
> bunch of subdirectories
> such as /dev, /lib, etc.  The common way to do this
> on a minimalistic
> system is to create a file system image in ROM
> (often compressed) and copy
> it to RAM on start up.  Given the questions you are
> asking, I am very
> confident creating a minimal RAM disk image will
> challenge you sufficiently
> :-).  I'm not being snide, lots of people with lots
> of linux knowledge have
> tried and failed.  Most people use someone else's
> pre-configured minimal
> file systems and add/subtract (mostly add :-)
> programs to it.  This is
> because it is very, very hard to create a minimal
> file system (that works,
> that is).
>
> Pointers to development systems with example RAM
> disk images:
>    http://www.denx.de/solutions-en.html
>      ftp://ftp.denx.de/pub/LinuxPPC/usr/src/SELF/
>    http://www.mvista.com/
>    (there are others, I'm just too lazy to do the
> google search for you)
>
> Trying to run linux without a file system of any
> sort would require you to
> rewrite of pretty much everything and the three or
> four things you didn't
> rewrite, you would have to rebuild (static link, no
> shared
> libraries).  There are a lot of software engineers
> and hackers that would
> turn down the opportunity to do this at any price.
> On the other hand, a
> lot of naivety and a even more coffee sometimes
> generates remarkable
> results :-).
>
> You really want to look at eCOS or one of the other
> light weight tasking OSs.
>    http://www.redhat.com/embedded/technologies/ecos/
>
> gvb
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:12   ` Jerry Van Baren
  2002-06-21 20:28     ` Tim Lai
@ 2002-06-21 20:31     ` Dr. Craig Hollabaugh
  2002-06-21 20:49       ` Tim Lai
                         ` (2 more replies)
  1 sibling, 3 replies; 27+ messages in thread
From: Dr. Craig Hollabaugh @ 2002-06-21 20:31 UTC (permalink / raw)
  To: Jerry Van Baren, linuxppc-embedded


At 04:12 PM 6/21/2002 -0400, Jerry Van Baren wrote:
>
>You need at least a RAM file system for "/" and a bunch of subdirectories
>such as /dev, /lib, etc.  The common way to do this on a minimalistic
>system is to create a file system image in ROM (often compressed) and copy
>it to RAM on start up.  Given the questions you are asking, I am very
>confident creating a minimal RAM disk image will challenge you sufficiently
>:-).  I'm not being snide, lots of people with lots of linux knowledge have
>tried and failed.  Most people use someone else's pre-configured minimal
>file systems and add/subtract (mostly add :-) programs to it.  This is
>because it is very, very hard to create a minimal file system (that works,
>that is).

I disagree. Creating a minimal root filesystem is easy once you understand what
happens when init executes. (Shameless plug here) In my Embedded Linux book, I show
you exactly the files needed to get bash running with a network connection. You use ldd to find out lib dependencies. Then copy binaries you want with their libs and some config files and your done. Here's my script to build such a root filesystem (http://www.embeddedlinuxinterfacing.com/chapters/04/buildrootfilesystem/buildrootfilesystem). Look it over, it probably won't make much sense without reading chapter 4.

I can say that a minimum RedHat install uses 29,296 files – 382.020MB, debian 10,734 files - 67.428MB, my minimal root filesystem 82 files and 4.8MB.


Here's a listing of tftproot directory

root@tbdev1[513]: cd /tftpboot/powerpc-rootfs/
root@tbdev1[514]: du -s
4824    .
root@tbdev1[515]: find .
.
./dev
./dev/tty
./dev/tty0
./dev/ttyS0
./dev/console
./dev/null
./dev/ram
./dev/initctl
./dev/mem
./dev/pts
./dev/ptyp0
./dev/ttyp0
./etc
./etc/init.d
./etc/init.d/rcS
./etc/init.d/umountfs
./etc/protocols
./etc/services
./etc/fstab
./etc/inittab
./etc/resolv.conf
./etc/mtab
./bin
./bin/bash
./bin/cat
./bin/ls
./bin/mount
./bin/umount
./bin/ps
./bin/df
./bin/kill
./bin/ping
./bin/chmod
./bin/touch
./bin/rm
./bin/echo
./bin/sh
./sbin
./sbin/init
./sbin/ifconfig
./sbin/route
./sbin/depmod
./sbin/insmod
./sbin/lsmod
./sbin/rmmod
./lib
./lib/ld-2.2.3.so
./lib/ld.so.1
./lib/libc-2.2.3.so
./lib/libc.so.6
./lib/libutil-2.2.3.so
./lib/libutil.so.1
./lib/libncurses.so.5
./lib/libncurses.so.5.2
./lib/libdl-2.2.3.so
./lib/libdl.so.2
./lib/libnss_dns-2.2.3.so
./lib/libnss_dns.so.2
./lib/libnss_files-2.2.3.so
./lib/libnss_files.so.2
./lib/libresolv-2.2.3.so
./lib/libresolv.so.2
./lib/libproc.so.2.0.7
./lib/librt-2.2.3.so
./lib/librt.so.1
./lib/libpthread-0.9.so
./lib/libpthread.so.0
./lib/libm-2.2.3.so
./lib/libm.so.6
./lib/libstdc++-3-libc6.1-2-2.10.0.so
./lib/libstdc++-libc6.1-2.so.3
./usr
./usr/bin
./usr/bin/telnet
./usr/bin/gdbserver
./usr/lib
./proc
./tmp


root@tbdev1[516]: find . | wc
     82      82    1212


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: Can I run linux without a file system?
@ 2002-06-21 20:41 Kerl, John
  0 siblings, 0 replies; 27+ messages in thread
From: Kerl, John @ 2002-06-21 20:41 UTC (permalink / raw)
  To: 'Jerry Van Baren', linuxppc-embedded


It's not *that* bad, is it? ;)

I have to admit I stumbled around for a while before
I got it right, but I do have a shell script for making
a RAM disk image, and I use it all the time.  Is anyone
interested in a copy?

-----Original Message-----
From: Jerry Van Baren [mailto:vanbaren_gerald@si.com]
Sent: Friday, June 21, 2002 1:12 PM
To: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Can I run linux without a file system?



You need at least a RAM file system for "/" and a bunch of subdirectories
such as /dev, /lib, etc.  The common way to do this on a minimalistic
system is to create a file system image in ROM (often compressed) and copy
it to RAM on start up.  Given the questions you are asking, I am very
confident creating a minimal RAM disk image will challenge you sufficiently
:-).  I'm not being snide, lots of people with lots of linux knowledge have
tried and failed.  Most people use someone else's pre-configured minimal
file systems and add/subtract (mostly add :-) programs to it.  This is
because it is very, very hard to create a minimal file system (that works,
that is).

Pointers to development systems with example RAM disk images:
   http://www.denx.de/solutions-en.html
     ftp://ftp.denx.de/pub/LinuxPPC/usr/src/SELF/
   http://www.mvista.com/
   (there are others, I'm just too lazy to do the google search for you)

Trying to run linux without a file system of any sort would require you to
rewrite of pretty much everything and the three or four things you didn't
rewrite, you would have to rebuild (static link, no shared
libraries).  There are a lot of software engineers and hackers that would
turn down the opportunity to do this at any price.  On the other hand, a
lot of naivety and a even more coffee sometimes generates remarkable
results :-).

You really want to look at eCOS or one of the other light weight tasking
OSs.
   http://www.redhat.com/embedded/technologies/ecos/

gvb


At 12:42 PM 6/21/2002 -0700, Tim Lai wrote:

>I am interested in both input/output operation
>on the console. If I just set CONFIG_SERIAL_CONSOLE,
>will I be able read input from the console?
>The main application will be started from init(),
>and the application will need to read and write
>to the console. Are there are method to communicate
>to the serial port other than open("/dev/ttyS0")?
>
>
> >
> > You don't need a filesystem to get output on the
> > serial console
> > you just need to enable the console with
> > CONFIG_SERIAL_CONSOLE=y
> > in your kernel configuration (atleast for mpc860
> > that all)
> > but you will have a hard time producing much more
> > than a blinking
> > cursor if you boot a Linux kernel and have no
> > application that
> > it then can run on the root-filesystem - what would
> > be the point
> > of such a setup - 1MB kernel code for a blinking
> > cursor on a
> > serial port seems expensive.
> >
> > hofrat
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:31     ` Dr. Craig Hollabaugh
@ 2002-06-21 20:49       ` Tim Lai
  2002-06-21 20:49         ` John W. Linville
  2002-06-21 20:54         ` Dr. Craig Hollabaugh
  2002-06-21 20:58       ` Jerry Van Baren
  2002-06-21 21:06       ` Wolfgang Denk
  2 siblings, 2 replies; 27+ messages in thread
From: Tim Lai @ 2002-06-21 20:49 UTC (permalink / raw)
  To: Dr. Craig Hollabaugh, Jerry Van Baren, linuxppc-embedded

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 335 bytes --]


>
> I can say that a minimum RedHat install uses 29,296
> files – 382.020MB, debian 10,734 files - 67.428MB,
> my minimal root filesystem 82 files and 4.8MB.
>
>

Do I need to install all these files in the file
system? Can I have "/", with no file in it?


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:49       ` Tim Lai
@ 2002-06-21 20:49         ` John W. Linville
  2002-06-21 20:54         ` Dr. Craig Hollabaugh
  1 sibling, 0 replies; 27+ messages in thread
From: John W. Linville @ 2002-06-21 20:49 UTC (permalink / raw)
  To: Tim Lai; +Cc: Dr. Craig Hollabaugh, Jerry Van Baren, linuxppc-embedded


Tim Lai wrote:
>
> Do I need to install all these files in the file
> system? Can I have "/", with no file in it?

Respectfully, I think perhaps you should call WindRiver or some other
traditional RTOS vendor.

If you insist on using Linux, I highly recommend you go to Amazon and
order Craig's book "Embedded Linux".  Make sure you get the one by Craig
Hollabaugh, as there is another book by the same title that is, well,
less useful...

Good luck.

John
--
John W. Linville
LVL7 Systems, Inc.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:49       ` Tim Lai
  2002-06-21 20:49         ` John W. Linville
@ 2002-06-21 20:54         ` Dr. Craig Hollabaugh
  2002-06-22  3:06           ` Tim Lai
  1 sibling, 1 reply; 27+ messages in thread
From: Dr. Craig Hollabaugh @ 2002-06-21 20:54 UTC (permalink / raw)
  To: Tim Lai, Jerry Van Baren, linuxppc-embedded


At 01:49 PM 6/21/2002 -0700, Tim Lai wrote:
>
>>
>> I can say that a minimum RedHat install uses 29,296
>> files – 382.020MB, debian 10,734 files - 67.428MB,
>> my minimal root filesystem 82 files and 4.8MB.
>>
>>
>
>Do I need to install all these files in the file
>system? Can I have "/", with no file in it?


What do you want to do? Do you want a shell, run a program, load a device driver? What is it exactly?

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:31     ` Dr. Craig Hollabaugh
  2002-06-21 20:49       ` Tim Lai
@ 2002-06-21 20:58       ` Jerry Van Baren
  2002-06-22  4:52         ` David Blythe
  2002-06-21 21:06       ` Wolfgang Denk
  2 siblings, 1 reply; 27+ messages in thread
From: Jerry Van Baren @ 2002-06-21 20:58 UTC (permalink / raw)
  To: linuxppc-embedded


OK, you and John Kerl caught me fear-mongering :-).  Thank you for the link
and shameless plug, it looks very, very useful.  4.8MB is very respectable
but not what most people think about when they say "minimal file
system".  Tim wants less than 1MByte, care to take up THAT challenge
:-)?  That would require shrinking the libraries to just the necessary
functions, which is a big jump in difficulty.

gvb


At 02:31 PM 6/21/2002 -0600, Dr. Craig Hollabaugh wrote:
>At 04:12 PM 6/21/2002 -0400, Jerry Van Baren wrote:
> >
> >You need at least a RAM file system for "/" and a bunch of subdirectories
> >such as /dev, /lib, etc.  The common way to do this on a minimalistic
> >system is to create a file system image in ROM (often compressed) and copy
> >it to RAM on start up.  Given the questions you are asking, I am very
> >confident creating a minimal RAM disk image will challenge you sufficiently
> >:-).  I'm not being snide, lots of people with lots of linux knowledge have
> >tried and failed.  Most people use someone else's pre-configured minimal
> >file systems and add/subtract (mostly add :-) programs to it.  This is
> >because it is very, very hard to create a minimal file system (that works,
> >that is).
>
>I disagree. Creating a minimal root filesystem is easy once you understand
>what
>happens when init executes. (Shameless plug here) In my Embedded Linux
>book, I show
>you exactly the files needed to get bash running with a network
>connection. You use ldd to find out lib dependencies. Then copy binaries
>you want with their libs and some config files and your done. Here's my
>script to build such a root filesystem
>(http://www.embeddedlinuxinterfacing.com/chapters/04/buildrootfilesystem/buildrootfilesystem).
>Look it over, it probably won't make much sense without reading chapter 4.
>
>I can say that a minimum RedHat install uses 29,296 files ­ 382.020MB,
>debian 10,734 files - 67.428MB, my minimal root filesystem 82 files and 4.8MB.

[snip]


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:31     ` Dr. Craig Hollabaugh
  2002-06-21 20:49       ` Tim Lai
  2002-06-21 20:58       ` Jerry Van Baren
@ 2002-06-21 21:06       ` Wolfgang Denk
  2 siblings, 0 replies; 27+ messages in thread
From: Wolfgang Denk @ 2002-06-21 21:06 UTC (permalink / raw)
  To: Dr. Craig Hollabaugh; +Cc: linuxppc-embedded


In message <3.0.3.32.20020621143133.006d37a8@hollabaugh.com> you wrote:
>
> I can say that a minimum RedHat install uses 29,296 files – 382.020MB, debian 10,734 files - 67.428MB, my minimal root filesystem 82 files and 4.8MB.

You cannot really call this a "minimal root filesystem".

A small (not even this is minimal, nor optimized) image can be found at
ftp://ftp.denx.de/pub/LinuxPPC/usr/src/mini-2048kB-ramdisk.image.gz

This has:
	-> find .
	.
	./lost+found
	./bin
	./bin/sh
	./bin/ls
	./dev
	./dev/ttyS0
	./dev/tty
	./dev/console
	./lib
	./lib/ld.so.1
	./lib/libc-1.99.so
	./lib/libc.so.6
	./lib/libtermcap.so.2.0.8
	./lib/libtermcap.so.2
	-> du -sk .
	1367    .

Obvious optimizations: rmdir lost+found, use busybox instead of  bash
+ ls, ...


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
Were there fewer fools, knaves would starve.              - Anonymous

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: Can I run linux without a file system?
@ 2002-06-21 21:13 Cameron, Steve
  2002-06-21 21:23 ` Wolfgang Denk
  2002-06-21 22:35 ` Conn Clark
  0 siblings, 2 replies; 27+ messages in thread
From: Cameron, Steve @ 2002-06-21 21:13 UTC (permalink / raw)
  To: Dr. Craig Hollabaugh, Jerry Van Baren, linuxppc-embedded


Dr. Craig Hollabaugh wrote:
>
> I can say that a minimum RedHat install uses 29,296 files -
> 382.020MB, debian 10,734 files - 67.428MB, my minimal root
> filesystem 82 files and 4.8MB.
>

Hmm, my minimal rootfs is (so far) 7 Mb, (as reported by du -s).
Or, is this 4Mb you cite compressed?  I wonder because my
libc.so is over 5 Mb. (which I got from DENX eldk-1.0)

Instead of ldd, I used "objdump -x $library | grep NEEDED"
which has the advantage that you can (er, that I know how to :-)
run it in a cross environment, so I don't have to fire up the
powerpc just to run ldd on a bunch of binaries.  (maybe
there's a way to cross run ldd? ) Using that, I wrote a script
(just today, as a matter of fact) to scan all the executables
and their libraries (and links to libs) iteratively until it
produced a minimal set, then deletes whatever isn't on the list,
which got me down to 7Mb with busybox and tinylogin as my only
apps.  (It occurs to me now that apps using dlopen() could be
a problem, but those are relatively rare.)

Any hints or links to into on crunching down the
individual libraries would be helpful.

BTW, nice book.

-- steve


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: Can I run linux without a file system?
@ 2002-06-21 21:17 Kerl, John
  2002-06-21 21:26 ` Roland Dreier
  2002-06-21 21:28 ` Wolfgang Denk
  0 siblings, 2 replies; 27+ messages in thread
From: Kerl, John @ 2002-06-21 21:17 UTC (permalink / raw)
  To: 'Jerry Van Baren',
	'linuxppc-embedded@lists.linuxppc.org',
	'laitingwai@yahoo.com'


My filesystem is 5.7 MB uncompressed.  And, for me
(sorry Wolfgang!) I think that *is* minimal.  Well,
not "minimal" in the sense of "as small as humanly
possible", but at least "miniature" -- compared to
more than 1000 MB for my desktop Linux host.  Our board
isn't big: it has 16 MB of flash & 64 MB of RAM,
can serve up telnet sessions & web pages, etc., and
I'm nowhere close to filling up either the flash
or the RAM.  & if I did want to cut space, I'd use
a small libc (now, I use glibc which is over a meg).

<><><><><><><><><><><><><><><><><><><><><><><><><><>

Anyway, here are some notes about the mkramdisk script,
and then the script follows.

My host has a directory called /usr/local/xdev/export
(pointed to by $xroot).  When my PPC board uses NFS root
(i.e.  nfsroot=1.2.3.4:/usr/local/xdev/export on the kernel
command line), it mounts /usr/local/xdev/export.  When the
board is not uisng NFS root, I take that same directory and
essentially pack it into a RAM-disk image.  The script
below just does that packing.

This simple picture is complicated by a few details:

*	One doesn't just make a zip or .tgz file; rather,
	one must must make a filesystem structure per se,
	that Linux on the PPC board can mount.

*	I could bulk-copy (cp -R) from $xroot to the
	filesystem image, *but* you can't cp around the
	files in /dev.  The script below is hackish
	in that I list out all the subdirectories in
	$xroot except /dev and copy them, then populate
	/dev using the mkdevs script (included after
	mkramdisk).  (It would be more elegant to use find
	with grep -v /dev.)

Note that the script below doesn't selectively choose what
to put into the RAM disk; it just copies everything in
$xroot into the RAM disk image.  What do I put in $xroot?
Things I manually create there (e.g. using a text editor on
my desktop host); cross-compiled executables; library files
taken from my cross-tools directory.

Here is the script; it takes no arguments.  It is run in
arch/ppc/mebboot (or wherever appropriate for your kernel
rev) & writes ramdisk.image.gz right where the kernel
makefile expects to find it.  (It must be run as root; note
that nothing else in my build process needs to run as
root.) So, whenever I modify $xroot, I cd to
arch/ppc/mebboot, su, sh mkramdisk, exit, cd to kernel
source base (../../..), make zImage.initrd, TFTP that up to
the board.


================================================================

#!/bin/sh
# mkramdisk
# See the file Documentation/initrd.txt.
# John Kerl
# john.kerl@avnet.com
# Avnet Design Services
# 2002-04-22

if [ -z "$xroot" ]; then
	echo "Must set \$xroot first." 1>&2
	exit 1
fi
src=$xroot
scratch=/ramdisktmp
dst=ramdisk.image

block_size=1024
num_blocks=8192

# ================================================================
if [ -f $scratch ]; then
	echo "$scratch already exists.  Exiting." 1>&2
	exit 1
fi

mkdir $scratch
if [ $? -ne 0 ]; then
	echo "Could not make directory $scratch.  Exiting." 1>&2
	exit 1
fi

echo ">>> Making zero-filled image file $dst ... "
dd if=/dev/zero of=$dst bs=$block_size count=$num_blocks
echo ">>> done."
echo ""

# Make 8MB filesystem in RAM:
#mke2fs -b $block_size $dst $num_blocks
echo ">>> Making empty filesystem in image file ... "
mke2fs -F -m0 $dst
echo ">>> done."
echo ""

echo ">>> Mounting $dst's filesystem to $scratch ... "
mount -t ext2 -o loop $dst $scratch
echo ">>> done."
echo ""

# ================================================================
# Everything other than board's dev can be copied from $xroot.

echo ">>> Copying $src/bin to $scratch/bin ... "
cp -R $src/bin $scratch
echo ">>> done."
echo ""

echo ">>> Copying $src/etc to $scratch/etc ... "
cp -R $src/etc $scratch
echo ">>> done."
echo ""

echo ">>> Copying $src/lib to $scratch/lib ... "
cp -R $src/lib $scratch
echo ">>> done."
echo ""

echo ">>> Making directory $scratch/tmp ... "
mkdir $scratch/tmp
echo ">>> done."
echo ""

echo ">>> Copying $src/var to $scratch/var ... "
cp -R $src/var $scratch
echo ">>> done."
echo ""

echo ">>> Copying $src/\*.txt to $scratch ... "
cp -R $src/*.txt $scratch
echo ">>> done."
echo ""

echo ">>> Copying $src plain files to $scratch ... "
for x in $src/*
do
	if [ -f $x ];then
		echo "      Copying $x to $scratch."
		cp $x $scratch
	fi
done
echo ">>> done."
echo ""

echo ">>> Making empty directories $scratch/dev and $scratch/proc ... "
mkdir $scratch/dev
mkdir $scratch/proc # This will be the mount point for the procfs.
echo ">>> done."
echo ""

# ================================================================
# Create board's /dev.

echo ">>> Populating $scratch/dev with device nodes ... "

sh mkdevs $scratch/dev

echo ">>> done."
echo ""

# ================================================================
umount $scratch
rmdir  $scratch

echo ">>> Compressing $dst to $dst.gz ... "
gzip -f -9 $dst
echo ">>> done."
echo ""

echo ""
echo ">>> RAM disk complete."
echo ""



================================================================
And here is the mkdevs script.
================================================================

#! /bin/sh
# mkdevs
# John Kerl
# john.kerl@avnet.com
# Avnet Design Services
# 2002-04-22

# ----------------------------------------------------------------
usage() {
	echo "Usage: $0 {directory name} {num ttys}" 1>&2
	exit 1
}

# ----------------------------------------------------------------
if [ $# -ne 1 ]; then
	usage
fi
if [ ! -d $1 ]; then
	echo "$0:  $1 is not a directory." 1>&2
	exit 1
fi

devdir=$1

# Maximum number of simultaneous telnet sessions:
num_ttys=32

# ----------------------------------------------------------------
mknod $devdir/console c  5  1

mknod $devdir/tty     c  5  0
mknod $devdir/ttyS0   c  4 64

i=0
while [ $i -lt $num_ttys ]
do
	mknod $devdir/ptyp$i   c  2 $i
	mknod $devdir/ttyp$i   c  3 $i
	i=`expr $i + 1`
done

mknod $devdir/led0    c 42  0
mknod $devdir/led1    c 42  1
mknod $devdir/led2    c 42  2
mknod $devdir/led3    c 42  3
mknod $devdir/led4    c 42  4
mknod $devdir/led5    c 42  5
mknod $devdir/led6    c 42  6
mknod $devdir/led7    c 42  7

mknod $devdir/mem     c  1  1
mknod $devdir/null    c  1  3
mknod $devdir/zero    c  1  5

mknod $devdir/ram0    b  1  0
mknod $devdir/ram1    b  1  1
ln -s $devdir/ram1 $devdir/ram


-----Original Message-----
From: Kerl, John
Sent: Friday, June 21, 2002 1:42 PM
To: 'Jerry Van Baren'; linuxppc-embedded@lists.linuxppc.org
Subject: RE: Can I run linux without a file system?


It's not *that* bad, is it? ;)

I have to admit I stumbled around for a while before
I got it right, but I do have a shell script for making
a RAM disk image, and I use it all the time.  Is anyone
interested in a copy?

-----Original Message-----
From: Jerry Van Baren [mailto:vanbaren_gerald@si.com]
Sent: Friday, June 21, 2002 1:12 PM
To: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Can I run linux without a file system?



You need at least a RAM file system for "/" and a bunch of subdirectories
such as /dev, /lib, etc.  The common way to do this on a minimalistic
system is to create a file system image in ROM (often compressed) and copy
it to RAM on start up.  Given the questions you are asking, I am very
confident creating a minimal RAM disk image will challenge you sufficiently
:-).  I'm not being snide, lots of people with lots of linux knowledge have
tried and failed.  Most people use someone else's pre-configured minimal
file systems and add/subtract (mostly add :-) programs to it.  This is
because it is very, very hard to create a minimal file system (that works,
that is).

Pointers to development systems with example RAM disk images:
   http://www.denx.de/solutions-en.html
     ftp://ftp.denx.de/pub/LinuxPPC/usr/src/SELF/
   http://www.mvista.com/
   (there are others, I'm just too lazy to do the google search for you)

Trying to run linux without a file system of any sort would require you to
rewrite of pretty much everything and the three or four things you didn't
rewrite, you would have to rebuild (static link, no shared
libraries).  There are a lot of software engineers and hackers that would
turn down the opportunity to do this at any price.  On the other hand, a
lot of naivety and a even more coffee sometimes generates remarkable
results :-).

You really want to look at eCOS or one of the other light weight tasking
OSs.
   http://www.redhat.com/embedded/technologies/ecos/

gvb


At 12:42 PM 6/21/2002 -0700, Tim Lai wrote:

>I am interested in both input/output operation
>on the console. If I just set CONFIG_SERIAL_CONSOLE,
>will I be able read input from the console?
>The main application will be started from init(),
>and the application will need to read and write
>to the console. Are there are method to communicate
>to the serial port other than open("/dev/ttyS0")?
>
>
> >
> > You don't need a filesystem to get output on the
> > serial console
> > you just need to enable the console with
> > CONFIG_SERIAL_CONSOLE=y
> > in your kernel configuration (atleast for mpc860
> > that all)
> > but you will have a hard time producing much more
> > than a blinking
> > cursor if you boot a Linux kernel and have no
> > application that
> > it then can run on the root-filesystem - what would
> > be the point
> > of such a setup - 1MB kernel code for a blinking
> > cursor on a
> > serial port seems expensive.
> >
> > hofrat
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 21:13 Cameron, Steve
@ 2002-06-21 21:23 ` Wolfgang Denk
  2002-06-21 22:35 ` Conn Clark
  1 sibling, 0 replies; 27+ messages in thread
From: Wolfgang Denk @ 2002-06-21 21:23 UTC (permalink / raw)
  To: Cameron, Steve; +Cc: linuxppc-embedded


In message <45B36A38D959B44CB032DA427A6E10640167CFE3@cceexc18.americas.cpqcorp.net> you wrote:
>
> Hmm, my minimal rootfs is (so far) 7 Mb, (as reported by du -s).
> Or, is this 4Mb you cite compressed?  I wonder because my
> libc.so is over 5 Mb. (which I got from DENX eldk-1.0)

Have a look at the SELF Makefile... you should run

$(CROSS_PREFIX)strip --remove-section=.note --remove-section=.comment *.so

on all libraries on the trarget filesystem.

> Any hints or links to into on crunching down the
> individual libraries would be helpful.

And for really limited cases there is ulibc, the  library  optimizer,
etc.

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
Ill-chosen abstraction is particularly evident in the design  of  the
ADA  runtime  system.  The  interface to the ADA runtime system is so
opaque that it is impossible to model  or  predict  its  performance,
making it effectively useless for real-time systems.
- Marc D.  Donner and David H. Jameson.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 21:17 Kerl, John
@ 2002-06-21 21:26 ` Roland Dreier
  2002-06-21 21:28 ` Wolfgang Denk
  1 sibling, 0 replies; 27+ messages in thread
From: Roland Dreier @ 2002-06-21 21:26 UTC (permalink / raw)
  To: Kerl, John
  Cc: 'Jerry Van Baren',
	'linuxppc-embedded@lists.linuxppc.org',
	'laitingwai@yahoo.com'


>>>>> "John" == John Kerl <Kerl> writes:

    John> * I could bulk-copy (cp -R) from $xroot to the filesystem
    John> image, *but* you can't cp around the files in /dev.  The
    John> script below is hackish in that I list out all the
    John> subdirectories in $xroot except /dev and copy them, then
    John> populate /dev using the mkdevs script (included after
    John> mkramdisk).  (It would be more elegant to use find with grep
    John> -v /dev.)

cp -a works like cp -R except it will copy /dev and symlinks properly.

Best,
  Roland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: Can I run linux without a file system?
@ 2002-06-21 21:27 Kerl, John
  0 siblings, 0 replies; 27+ messages in thread
From: Kerl, John @ 2002-06-21 21:27 UTC (permalink / raw)
  To: 'Roland Dreier', Kerl, John
  Cc: 'Jerry Van Baren',
	'linuxppc-embedded@lists.linuxppc.org',
	'laitingwai@yahoo.com'


cp -a --- well, you learn something every day.
Guess I can go home now. :)

Thx.


-----Original Message-----
From: Roland Dreier [mailto:roland@topspin.com]
Sent: Friday, June 21, 2002 2:26 PM
To: Kerl, John
Cc: 'Jerry Van Baren'; 'linuxppc-embedded@lists.linuxppc.org';
'laitingwai@yahoo.com'
Subject: Re: Can I run linux without a file system?
Importance: High


>>>>> "John" == John Kerl <Kerl> writes:

    John> * I could bulk-copy (cp -R) from $xroot to the filesystem
    John> image, *but* you can't cp around the files in /dev.  The
    John> script below is hackish in that I list out all the
    John> subdirectories in $xroot except /dev and copy them, then
    John> populate /dev using the mkdevs script (included after
    John> mkramdisk).  (It would be more elegant to use find with grep
    John> -v /dev.)

cp -a works like cp -R except it will copy /dev and symlinks properly.

Best,
  Roland

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 21:17 Kerl, John
  2002-06-21 21:26 ` Roland Dreier
@ 2002-06-21 21:28 ` Wolfgang Denk
  1 sibling, 0 replies; 27+ messages in thread
From: Wolfgang Denk @ 2002-06-21 21:28 UTC (permalink / raw)
  To: Kerl, John
  Cc: 'Jerry Van Baren',
	'linuxppc-embedded@lists.linuxppc.org',
	'laitingwai@yahoo.com'


Dear Karl,

in message <C08678384BE7D311B4D70004ACA371050B76351E@amer22.avnet.com> you wrote:
>
> My filesystem is 5.7 MB uncompressed.  And, for me
> (sorry Wolfgang!) I think that *is* minimal.  Well,
> not "minimal" in the sense of "as small as humanly
> possible", but at least "miniature" -- compared to
> more than 1000 MB for my desktop Linux host.  Our board
> isn't big: it has 16 MB of flash & 64 MB of RAM,
> can serve up telnet sessions & web pages, etc., and

Well, that's about what SELF contains -  which  takes  about  2.2  MB
uncompressed, 830 kB compressed.

> *	One doesn't just make a zip or .tgz file; rather,
> 	one must must make a filesystem structure per se,
> 	that Linux on the PPC board can mount.

There are patches out there that can load a .tgz file into a  ramdisk
upon boot, so instead a ramdisk image you can load a tarball.

> *	I could bulk-copy (cp -R) from $xroot to the
> 	filesystem image, *but* you can't cp around the
> 	files in /dev.  The script below is hackish

You can. RTFM. Pay attention to options like '-a' or '-R'.


Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
"If you can, help others. If you can't, at least don't hurt  others."
- the Dalai Lama

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* RE: Can I run linux without a file system?
@ 2002-06-21 21:46 Cameron, Steve
  0 siblings, 0 replies; 27+ messages in thread
From: Cameron, Steve @ 2002-06-21 21:46 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-embedded


Wolfgang Denk wrote:
> In message
> <45B36A38D959B44CB032DA427A6E10640167CFE3@cceexc18.americas.cpqcorp.net> you wrote:
> >
> > Hmm, my minimal rootfs is (so far) 7 Mb,
[...]
> Have a look at the SELF Makefile... you should run
>
> $(CROSS_PREFIX)strip --remove-section=.note --remove-section=.comment *.so

Whoa! That is better.  ~2.8 Mb now, as reported by du. Thanks!

-- steve


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 21:13 Cameron, Steve
  2002-06-21 21:23 ` Wolfgang Denk
@ 2002-06-21 22:35 ` Conn Clark
  1 sibling, 0 replies; 27+ messages in thread
From: Conn Clark @ 2002-06-21 22:35 UTC (permalink / raw)
  To: Cameron, Steve, May Ling List


"Cameron, Steve" wrote:
>
> Dr. Craig Hollabaugh wrote:
> >
> > I can say that a minimum RedHat install uses 29,296 files -
> > 382.020MB, debian 10,734 files - 67.428MB, my minimal root
> > filesystem 82 files and 4.8MB.
> >
>
> Hmm, my minimal rootfs is (so far) 7 Mb, (as reported by du -s).
> Or, is this 4Mb you cite compressed?  I wonder because my
> libc.so is over 5 Mb. (which I got from DENX eldk-1.0)
>

Did you use ppc-8xx-strip on it? It gets rid of all that nasty
debugging bloat. Our libc is 1275512 bytes after stripping. Our
uncompressed ramdisk is 4879K. If you are realy hurting try rebuilding
everything using the "-Os -mstring -mmultiple" optimizations.


As for the original question "Can I run linux without a file system?",
If you don't need a file system, mabey the question should be do you
realy need linux. It may just be easier to make an executable to sit
on something like PPCBoot. (just a thought)

good luck.

	Conn
--

*****************************************************************
  If you live at home long enough, your parents will move out.
 (Warning they may try to sell their house out from under you.)
*****************************************************************

Conn Clark
Engineering Stooge				clark@esteem.com
Electronic Systems Technology Inc.		www.esteem.com


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:54         ` Dr. Craig Hollabaugh
@ 2002-06-22  3:06           ` Tim Lai
  0 siblings, 0 replies; 27+ messages in thread
From: Tim Lai @ 2002-06-22  3:06 UTC (permalink / raw)
  To: Dr. Craig Hollabaugh, linuxppc-embedded


> >
> >Do I need to install all these files in the file
> >system? Can I have "/", with no file in it?
>
>
> What do you want to do? Do you want a shell, run a
> program, load a device driver? What is it exactly?
>

I 'll run my application which is build in the kernel.

No shell in the beginning. But I will need the shell
later when more NVRAM is available. With the hardware
that I have in the future, I can build my application
seperately and store it in the file system. The
application do some network processing, I'll not
have any display other then the console and maybe
telnet session.

Where or how do I get these lib for ppc?
         ./lib/ld.so.1
	./lib/libc-1.99.so
	./lib/libc.so.6
	./lib/libtermcap.so.2.0.8
	./lib/libtermcap.so.2

BTW, I just ordered the Dr.Hollabaugh's book.
Thanks for the advice.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: Can I run linux without a file system?
  2002-06-21 20:58       ` Jerry Van Baren
@ 2002-06-22  4:52         ` David Blythe
  0 siblings, 0 replies; 27+ messages in thread
From: David Blythe @ 2002-06-22  4:52 UTC (permalink / raw)
  To: linuxppc-embedded


use uclibc and busybox.  it is pretty straightforward to get a root file
system smaller than 1M with lots of useful stuff, either with or without
shared libraries (shared uclibc is < 300K including ld.so on my ppc
system, busybox is 200K including ash,mv,cp,ls,...).  The downside is
you have to build all of the stuff yourself, but if you want to optimize
for space, sooner or later you'll end up building it all yourself.

	david


Jerry Van Baren wrote:
>
> OK, you and John Kerl caught me fear-mongering :-).  Thank you for the link
> and shameless plug, it looks very, very useful.  4.8MB is very respectable
> but not what most people think about when they say "minimal file
> system".  Tim wants less than 1MByte, care to take up THAT challenge
> :-)?  That would require shrinking the libraries to just the necessary
> functions, which is a big jump in difficulty.
>
> gvb
>
>
> At 02:31 PM 6/21/2002 -0600, Dr. Craig Hollabaugh wrote:
>
...


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2002-06-22  4:52 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-21 19:22 Can I run Linux without a file system? Hihn Jason
2002-06-21 19:35 ` Tim Lai
2002-06-21 19:46   ` Re[2]: " Ricardo Scop
2002-06-21 19:50   ` Dan Malek
2002-06-21 20:18     ` Tim Lai
  -- strict thread matches above, loose matches on Subject: below --
2002-06-21 21:46 Can I run linux " Cameron, Steve
2002-06-21 21:27 Kerl, John
2002-06-21 21:17 Kerl, John
2002-06-21 21:26 ` Roland Dreier
2002-06-21 21:28 ` Wolfgang Denk
2002-06-21 21:13 Cameron, Steve
2002-06-21 21:23 ` Wolfgang Denk
2002-06-21 22:35 ` Conn Clark
2002-06-21 20:41 Kerl, John
     [not found] <200206211835.g5LIZDL01282@hofr.at>
2002-06-21 19:42 ` Tim Lai
2002-06-21 20:12   ` Jerry Van Baren
2002-06-21 20:28     ` Tim Lai
2002-06-21 20:31     ` Dr. Craig Hollabaugh
2002-06-21 20:49       ` Tim Lai
2002-06-21 20:49         ` John W. Linville
2002-06-21 20:54         ` Dr. Craig Hollabaugh
2002-06-22  3:06           ` Tim Lai
2002-06-21 20:58       ` Jerry Van Baren
2002-06-22  4:52         ` David Blythe
2002-06-21 21:06       ` Wolfgang Denk
2002-06-21 15:08 Tim Lai
2002-06-21 19:54 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).