public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* linux kernel without file system
@ 2009-01-14  8:30 Philippe De Muyter
  2009-01-14 10:15 ` Alan Cox
  0 siblings, 1 reply; 22+ messages in thread
From: Philippe De Muyter @ 2009-01-14  8:30 UTC (permalink / raw)
  To: linux-kernel

Hello list,

I need to design a very small embedded system that must only control
one ethernet port and two serial lines and must fit in a very small flash
memory.  So I thought about replacing the call to /etc/init by my application
program and removing all the file-system part of linux.

Is that doable ?

Is there a 'standard' way of doing that ?

The first problem I see is accessing my serial lines.  How could I do that
without using open("/dev/ttySx"), which requires a file system ?

Is there a way to access devices that does not require a file-system ?

Thanks for reading this far

Philippe

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

* Re: linux kernel without file system
@ 2009-01-14  8:46 Tomasz Chmielewski
  2009-01-14  9:34 ` Philippe De Muyter
  0 siblings, 1 reply; 22+ messages in thread
From: Tomasz Chmielewski @ 2009-01-14  8:46 UTC (permalink / raw)
  To: LKML, phdm

> I need to design a very small embedded system that must only control
> one ethernet port and two serial lines and must fit in a very small flash
> memory.  So I thought about replacing the call to /etc/init by my application
> program and removing all the file-system part of linux.
> 
> Is that doable ?
> 
> Is there a 'standard' way of doing that ?
> 
> The first problem I see is accessing my serial lines.  How could I do that
> without using open("/dev/ttySx"), which requires a file system ?
> 
> Is there a way to access devices that does not require a file-system ?

You could put everything in initramfs (and embed it in the kernel).


-- 
Tomasz Chmielewski
http://wpkg.org

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

* Re: linux kernel without file system
  2009-01-14  8:46 linux kernel without file system Tomasz Chmielewski
@ 2009-01-14  9:34 ` Philippe De Muyter
  2009-01-14  9:52   ` Xavier Bestel
                     ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Philippe De Muyter @ 2009-01-14  9:34 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: LKML

On Wed, Jan 14, 2009 at 09:46:48AM +0100, Tomasz Chmielewski wrote:
>> I need to design a very small embedded system that must only control
>> one ethernet port and two serial lines and must fit in a very small flash
>> memory.  So I thought about replacing the call to /etc/init by my 
>> application
>> program and removing all the file-system part of linux.
>> Is that doable ?
>> Is there a 'standard' way of doing that ?
>> The first problem I see is accessing my serial lines.  How could I do that
>> without using open("/dev/ttySx"), which requires a file system ?
>> Is there a way to access devices that does not require a file-system ?
>
> You could put everything in initramfs (and embed it in the kernel).

Actually, I was thinking about reducing the footprint of my kernel by
removing all the fs-related system calls, so the problem is not where
the file-system is, but how to access (serial) devices without giving their
"/dev/..." name.

Thanks anyway

Philippe

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

* Re: linux kernel without file system
  2009-01-14  9:34 ` Philippe De Muyter
@ 2009-01-14  9:52   ` Xavier Bestel
  2009-01-14 10:18     ` Philippe De Muyter
  2009-01-14 10:34     ` Kay Sievers
  2009-01-14 11:59   ` Arnd Bergmann
                     ` (2 subsequent siblings)
  3 siblings, 2 replies; 22+ messages in thread
From: Xavier Bestel @ 2009-01-14  9:52 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Tomasz Chmielewski, LKML


On Wed, 2009-01-14 at 10:34 +0100, Philippe De Muyter wrote:
> On Wed, Jan 14, 2009 at 09:46:48AM +0100, Tomasz Chmielewski wrote:
> >> I need to design a very small embedded system that must only control
> >> one ethernet port and two serial lines and must fit in a very small flash
> >> memory.  So I thought about replacing the call to /etc/init by my 
> >> application
> >> program and removing all the file-system part of linux.
> >> Is that doable ?
> >> Is there a 'standard' way of doing that ?
> >> The first problem I see is accessing my serial lines.  How could I do that
> >> without using open("/dev/ttySx"), which requires a file system ?
> >> Is there a way to access devices that does not require a file-system ?
> >
> > You could put everything in initramfs (and embed it in the kernel).
> 
> Actually, I was thinking about reducing the footprint of my kernel by
> removing all the fs-related system calls, so the problem is not where
> the file-system is, but how to access (serial) devices without giving their
> "/dev/..." name.

You can still mount sysfs somewhere and access the device nodes from
there.

	Xav



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

* Re: linux kernel without file system
  2009-01-14  8:30 Philippe De Muyter
@ 2009-01-14 10:15 ` Alan Cox
  2009-01-15 15:34   ` Enrico Weigelt
  0 siblings, 1 reply; 22+ messages in thread
From: Alan Cox @ 2009-01-14 10:15 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: linux-kernel

> Is there a way to access devices that does not require a file-system ?

No: but you can run with just your own programs and bits needed loaded
off an initial ramdisk or a romfs image. A better place to ask and learn
is probably the "busybox" list as most people doing this stuff use
busybox for their tools

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

* Re: linux kernel without file system
  2009-01-14  9:52   ` Xavier Bestel
@ 2009-01-14 10:18     ` Philippe De Muyter
  2009-01-14 14:27       ` Rogan Dawes
  2009-01-14 10:34     ` Kay Sievers
  1 sibling, 1 reply; 22+ messages in thread
From: Philippe De Muyter @ 2009-01-14 10:18 UTC (permalink / raw)
  To: Xavier Bestel; +Cc: Tomasz Chmielewski, LKML

On Wed, Jan 14, 2009 at 10:52:24AM +0100, Xavier Bestel wrote:
> 
> On Wed, 2009-01-14 at 10:34 +0100, Philippe De Muyter wrote:
> > On Wed, Jan 14, 2009 at 09:46:48AM +0100, Tomasz Chmielewski wrote:
> > >> I need to design a very small embedded system that must only control
> > >> one ethernet port and two serial lines and must fit in a very small flash
> > >> memory.  So I thought about replacing the call to /etc/init by my 
> > >> application
> > >> program and removing all the file-system part of linux.
> > >> Is that doable ?
> > >> Is there a 'standard' way of doing that ?
> > >> The first problem I see is accessing my serial lines.  How could I do that
> > >> without using open("/dev/ttySx"), which requires a file system ?
> > >> Is there a way to access devices that does not require a file-system ?
> > >
> > > You could put everything in initramfs (and embed it in the kernel).
> > 
> > Actually, I was thinking about reducing the footprint of my kernel by
> > removing all the fs-related system calls, so the problem is not where
> > the file-system is, but how to access (serial) devices without giving their
> > "/dev/..." name.
> 
> You can still mount sysfs somewhere and access the device nodes from
> there.

Keeping thinking about it, I now think that my 'application program'
(basically a serial-to-ethernet converter) should be a kernel thread,
because of the small memory constraints.

The question is thus how to access the serial lines from a kernel thread.

Philippe

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

* Re: linux kernel without file system
  2009-01-14  9:52   ` Xavier Bestel
  2009-01-14 10:18     ` Philippe De Muyter
@ 2009-01-14 10:34     ` Kay Sievers
  2009-01-14 13:49       ` Xavier Bestel
  2009-01-17 19:38       ` Enrico Weigelt
  1 sibling, 2 replies; 22+ messages in thread
From: Kay Sievers @ 2009-01-14 10:34 UTC (permalink / raw)
  To: Xavier Bestel; +Cc: Philippe De Muyter, Tomasz Chmielewski, LKML

On Wed, Jan 14, 2009 at 10:52, Xavier Bestel <xavier.bestel@free.fr> wrote:
> On Wed, 2009-01-14 at 10:34 +0100, Philippe De Muyter wrote:
>> On Wed, Jan 14, 2009 at 09:46:48AM +0100, Tomasz Chmielewski wrote:
>> >> I need to design a very small embedded system that must only control
>> >> one ethernet port and two serial lines and must fit in a very small flash
>> >> memory.  So I thought about replacing the call to /etc/init by my
>> >> application
>> >> program and removing all the file-system part of linux.
>> >> Is that doable ?
>> >> Is there a 'standard' way of doing that ?
>> >> The first problem I see is accessing my serial lines.  How could I do that
>> >> without using open("/dev/ttySx"), which requires a file system ?
>> >> Is there a way to access devices that does not require a file-system ?
>> >
>> > You could put everything in initramfs (and embed it in the kernel).
>>
>> Actually, I was thinking about reducing the footprint of my kernel by
>> removing all the fs-related system calls, so the problem is not where
>> the file-system is, but how to access (serial) devices without giving their
>> "/dev/..." name.
>
> You can still mount sysfs somewhere and access the device nodes from
> there.

There are no device nodes in sysfs to talk to the device, only
attributes, which are mostly plain small text files. For some devices
there are a few writable and mappable files which can change the
device's state, but that's nothing like a device node.

Kay

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

* Re: linux kernel without file system
  2009-01-14  9:34 ` Philippe De Muyter
  2009-01-14  9:52   ` Xavier Bestel
@ 2009-01-14 11:59   ` Arnd Bergmann
  2009-01-14 12:18     ` Philippe De Muyter
  2009-01-14 14:27   ` David Newall
  2009-01-14 17:02   ` John Stoffel
  3 siblings, 1 reply; 22+ messages in thread
From: Arnd Bergmann @ 2009-01-14 11:59 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Tomasz Chmielewski, LKML

On Wednesday 14 January 2009, Philippe De Muyter wrote:
> Actually, I was thinking about reducing the footprint of my kernel by
> removing all the fs-related system calls, so the problem is not where
> the file-system is, but how to access (serial) devices without giving their
> "/dev/..." name.

One thing that you can do is remove support for block devices in somewhat
recent kernels, which gets you most of the way. File systems themselves
are required for the majority of all system calls (anything that takes
a file descriptor) and for the boot process.

	Arnd <><

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

* Re: linux kernel without file system
  2009-01-14 11:59   ` Arnd Bergmann
@ 2009-01-14 12:18     ` Philippe De Muyter
  0 siblings, 0 replies; 22+ messages in thread
From: Philippe De Muyter @ 2009-01-14 12:18 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: Tomasz Chmielewski, LKML

On Wed, Jan 14, 2009 at 12:59:49PM +0100, Arnd Bergmann wrote:
> On Wednesday 14 January 2009, Philippe De Muyter wrote:
> > Actually, I was thinking about reducing the footprint of my kernel by
> > removing all the fs-related system calls, so the problem is not where
> > the file-system is, but how to access (serial) devices without giving their
> > "/dev/..." name.
> 
> One thing that you can do is remove support for block devices in somewhat
> recent kernels, which gets you most of the way. File systems themselves
> are required for the majority of all system calls (anything that takes
> a file descriptor) and for the boot process.

file descriptor is actually an historical name, now too particular.

I would like to keep sockets and serial lines, for which the handle is a
"file descriptor", but not use any file.  So, of course I need to keep
write(), read(), poll(), socket() etc, but not open(), link(), mknod() and
everything that walks a directory tree.

Philippe

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

* Re: linux kernel without file system
  2009-01-14 10:34     ` Kay Sievers
@ 2009-01-14 13:49       ` Xavier Bestel
  2009-01-17 19:38       ` Enrico Weigelt
  1 sibling, 0 replies; 22+ messages in thread
From: Xavier Bestel @ 2009-01-14 13:49 UTC (permalink / raw)
  To: Kay Sievers; +Cc: Philippe De Muyter, Tomasz Chmielewski, LKML

Oh yes sorry, I mixed that with the dev entry in sysfs, which contains
the device major:minor in textual form (e.g. /sys/block/fd0/dev).
Confused memory ...

	Xav

On Wed, 2009-01-14 at 11:34 +0100, Kay Sievers wrote:
> On Wed, Jan 14, 2009 at 10:52, Xavier Bestel <xavier.bestel@free.fr> wrote:
> > On Wed, 2009-01-14 at 10:34 +0100, Philippe De Muyter wrote:
> >> On Wed, Jan 14, 2009 at 09:46:48AM +0100, Tomasz Chmielewski wrote:
> >> >> I need to design a very small embedded system that must only control
> >> >> one ethernet port and two serial lines and must fit in a very small flash
> >> >> memory.  So I thought about replacing the call to /etc/init by my
> >> >> application
> >> >> program and removing all the file-system part of linux.
> >> >> Is that doable ?
> >> >> Is there a 'standard' way of doing that ?
> >> >> The first problem I see is accessing my serial lines.  How could I do that
> >> >> without using open("/dev/ttySx"), which requires a file system ?
> >> >> Is there a way to access devices that does not require a file-system ?
> >> >
> >> > You could put everything in initramfs (and embed it in the kernel).
> >>
> >> Actually, I was thinking about reducing the footprint of my kernel by
> >> removing all the fs-related system calls, so the problem is not where
> >> the file-system is, but how to access (serial) devices without giving their
> >> "/dev/..." name.
> >
> > You can still mount sysfs somewhere and access the device nodes from
> > there.
> 
> There are no device nodes in sysfs to talk to the device, only
> attributes, which are mostly plain small text files. For some devices
> there are a few writable and mappable files which can change the
> device's state, but that's nothing like a device node.
> 
> Kay
> 



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

* Re: linux kernel without file system
  2009-01-14  9:34 ` Philippe De Muyter
  2009-01-14  9:52   ` Xavier Bestel
  2009-01-14 11:59   ` Arnd Bergmann
@ 2009-01-14 14:27   ` David Newall
  2009-01-14 14:49     ` Philippe De Muyter
  2009-01-14 17:02   ` John Stoffel
  3 siblings, 1 reply; 22+ messages in thread
From: David Newall @ 2009-01-14 14:27 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Tomasz Chmielewski, LKML

Philippe De Muyter wrote:
> Actually, I was thinking about reducing the footprint of my kernel by
> removing all the fs-related system calls, so the problem is not where
> the file-system is, but how to access (serial) devices without giving their
> "/dev/..." name.

That's fighting the UNIX design, in "which everything is a file."  You
can remove all of the disk-based filesystems, but if you try to remove
open, close, read or write there'll be almost nothing that you can
usefully do.

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

* Re: linux kernel without file system
  2009-01-14 10:18     ` Philippe De Muyter
@ 2009-01-14 14:27       ` Rogan Dawes
  2009-01-14 14:52         ` Philippe De Muyter
  0 siblings, 1 reply; 22+ messages in thread
From: Rogan Dawes @ 2009-01-14 14:27 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Xavier Bestel, Tomasz Chmielewski, LKML

Philippe De Muyter wrote:

> Keeping thinking about it, I now think that my 'application program'
> (basically a serial-to-ethernet converter) should be a kernel thread,
> because of the small memory constraints.
> 
> The question is thus how to access the serial lines from a kernel thread.
> 
> Philippe

If your constraints are that severe, perhaps you should be investigating
other solutions. e.g. eCos?

Linux doesn't ALWAYS have to be the answer :-)

Rogan

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

* Re: linux kernel without file system
  2009-01-14 14:27   ` David Newall
@ 2009-01-14 14:49     ` Philippe De Muyter
  2009-01-14 15:14       ` David Newall
  0 siblings, 1 reply; 22+ messages in thread
From: Philippe De Muyter @ 2009-01-14 14:49 UTC (permalink / raw)
  To: David Newall; +Cc: Tomasz Chmielewski, LKML

On Thu, Jan 15, 2009 at 12:57:55AM +1030, David Newall wrote:
> Philippe De Muyter wrote:
> > Actually, I was thinking about reducing the footprint of my kernel by
> > removing all the fs-related system calls, so the problem is not where
> > the file-system is, but how to access (serial) devices without giving their
> > "/dev/..." name.
> 
> That's fighting the UNIX design, in "which everything is a file."  You
> can remove all of the disk-based filesystems, but if you try to remove
> open, close, read or write there'll be almost nothing that you can
> usefully do.

Of course, I need read, write and ioctl and socket and friends but I do not
need open, creat, link, rename etc.

Philippe

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

* Re: linux kernel without file system
  2009-01-14 14:27       ` Rogan Dawes
@ 2009-01-14 14:52         ` Philippe De Muyter
  2009-01-14 14:57           ` Rogan Dawes
  0 siblings, 1 reply; 22+ messages in thread
From: Philippe De Muyter @ 2009-01-14 14:52 UTC (permalink / raw)
  To: Rogan Dawes; +Cc: Xavier Bestel, Tomasz Chmielewski, LKML

On Wed, Jan 14, 2009 at 04:27:55PM +0200, Rogan Dawes wrote:
> Philippe De Muyter wrote:
> 
> > Keeping thinking about it, I now think that my 'application program'
> > (basically a serial-to-ethernet converter) should be a kernel thread,
> > because of the small memory constraints.
> > 
> > The question is thus how to access the serial lines from a kernel thread.
> > 
> > Philippe
> 
> If your constraints are that severe, perhaps you should be investigating
> other solutions. e.g. eCos?

I like to reuse (and contribute to) the linux drivers and kernel.

> Linux doesn't ALWAYS have to be the answer :-)

No ? :)

Philippe

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

* Re: linux kernel without file system
  2009-01-14 14:52         ` Philippe De Muyter
@ 2009-01-14 14:57           ` Rogan Dawes
  2009-01-14 15:24             ` Philippe De Muyter
  0 siblings, 1 reply; 22+ messages in thread
From: Rogan Dawes @ 2009-01-14 14:57 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Xavier Bestel, Tomasz Chmielewski, LKML

Philippe De Muyter wrote:
> On Wed, Jan 14, 2009 at 04:27:55PM +0200, Rogan Dawes wrote:
>> Philippe De Muyter wrote:
>>
>>> Keeping thinking about it, I now think that my 'application program'
>>> (basically a serial-to-ethernet converter) should be a kernel thread,
>>> because of the small memory constraints.
>>>
>>> The question is thus how to access the serial lines from a kernel thread.
>>>
>>> Philippe
>> If your constraints are that severe, perhaps you should be investigating
>> other solutions. e.g. eCos?
> 
> I like to reuse (and contribute to) the linux drivers and kernel.
> 
>> Linux doesn't ALWAYS have to be the answer :-)
> 
> No ? :)
> 
> Philippe
> 

Ok, in that case, perhaps you should explain exactly what your
constraints are (target board, max memory/flash, etc), and maybe folks
will be able to provide more sensible answers.

Good luck!

Rogan

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

* Re: linux kernel without file system
  2009-01-14 14:49     ` Philippe De Muyter
@ 2009-01-14 15:14       ` David Newall
  0 siblings, 0 replies; 22+ messages in thread
From: David Newall @ 2009-01-14 15:14 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Tomasz Chmielewski, LKML

Philippe De Muyter wrote:
> On Thu, Jan 15, 2009 at 12:57:55AM +1030, David Newall wrote:
>   
>> Philippe De Muyter wrote:
>>     
>>> Actually, I was thinking about reducing the footprint of my kernel by
>>> removing all the fs-related system calls, so the problem is not where
>>> the file-system is, but how to access (serial) devices without giving their
>>> "/dev/..." name.
>>>       
>> That's fighting the UNIX design, in "which everything is a file."  You
>> can remove all of the disk-based filesystems, but if you try to remove
>> open, close, read or write there'll be almost nothing that you can
>> usefully do.
>>     
>
> Of course, I need read, write and ioctl and socket and friends but I do not
> need open, creat, link, rename etc.

I think you do need open; how else will you open the serial port?

The best advice I can offer is: Don't think about kernel threads,
user-space is where you should be; and don't think about removing system
calls.  If your application truly is so tight, linux might not be the
right tool for you.

Maybe the embedded linux list might be more in tune with what you're
thinking.

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

* Re: linux kernel without file system
  2009-01-14 14:57           ` Rogan Dawes
@ 2009-01-14 15:24             ` Philippe De Muyter
  2009-01-14 15:31               ` Rogan Dawes
  2009-01-15 18:06               ` Arnd Bergmann
  0 siblings, 2 replies; 22+ messages in thread
From: Philippe De Muyter @ 2009-01-14 15:24 UTC (permalink / raw)
  To: Rogan Dawes; +Cc: Xavier Bestel, Tomasz Chmielewski, LKML

On Wed, Jan 14, 2009 at 04:57:09PM +0200, Rogan Dawes wrote:
> Philippe De Muyter wrote:
> > On Wed, Jan 14, 2009 at 04:27:55PM +0200, Rogan Dawes wrote:
> >> Philippe De Muyter wrote:
> >>
> >>> Keeping thinking about it, I now think that my 'application program'
> >>> (basically a serial-to-ethernet converter) should be a kernel thread,
> >>> because of the small memory constraints.
> >>>
> >>> The question is thus how to access the serial lines from a kernel thread.
> >>>
> >>> Philippe
> >> If your constraints are that severe, perhaps you should be investigating
> >> other solutions. e.g. eCos?
> > 
> > I like to reuse (and contribute to) the linux drivers and kernel.
> > 
> >> Linux doesn't ALWAYS have to be the answer :-)
> > 
> > No ? :)
> > 
> > Philippe
> > 
> 
> Ok, in that case, perhaps you should explain exactly what your
> constraints are (target board, max memory/flash, etc), and maybe folks
> will be able to provide more sensible answers.

if possible, mcf52236 (256k flash 32k sram in chip) :)

kernel+uapplication XIP in flash

they seems to push something called utasker

Philippe

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

* Re: linux kernel without file system
  2009-01-14 15:24             ` Philippe De Muyter
@ 2009-01-14 15:31               ` Rogan Dawes
  2009-01-15 18:06               ` Arnd Bergmann
  1 sibling, 0 replies; 22+ messages in thread
From: Rogan Dawes @ 2009-01-14 15:31 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Xavier Bestel, Tomasz Chmielewski, LKML

Philippe De Muyter wrote:
> On Wed, Jan 14, 2009 at 04:57:09PM +0200, Rogan Dawes wrote:
>> Ok, in that case, perhaps you should explain exactly what your
>> constraints are (target board, max memory/flash, etc), and maybe folks
>> will be able to provide more sensible answers.
> 
> if possible, mcf52236 (256k flash 32k sram in chip) :)

256kB flash? Good luck with that!

> kernel+uapplication XIP in flash
> 
> they seems to push something called utasker

Maybe it is the best solution . . .

Rogan

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

* Re: linux kernel without file system
  2009-01-14  9:34 ` Philippe De Muyter
                     ` (2 preceding siblings ...)
  2009-01-14 14:27   ` David Newall
@ 2009-01-14 17:02   ` John Stoffel
  3 siblings, 0 replies; 22+ messages in thread
From: John Stoffel @ 2009-01-14 17:02 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Tomasz Chmielewski, LKML

>>>>> "Philippe" == Philippe De Muyter <phdm@macqel.be> writes:

Philippe> On Wed, Jan 14, 2009 at 09:46:48AM +0100, Tomasz Chmielewski wrote:
>>> I need to design a very small embedded system that must only control
>>> one ethernet port and two serial lines and must fit in a very small flash
>>> memory.  So I thought about replacing the call to /etc/init by my 
>>> application
>>> program and removing all the file-system part of linux.
>>> Is that doable ?
>>> Is there a 'standard' way of doing that ?
>>> The first problem I see is accessing my serial lines.  How could I do that
>>> without using open("/dev/ttySx"), which requires a file system ?
>>> Is there a way to access devices that does not require a file-system ?
>> 
>> You could put everything in initramfs (and embed it in the kernel).

Philippe> Actually, I was thinking about reducing the footprint of my
Philippe> kernel by removing all the fs-related system calls, so the
Philippe> problem is not where the file-system is, but how to access
Philippe> (serial) devices without giving their "/dev/..." name.

Does it have to be linux?  I've been playing with Arduino boards
(http://www.adafruit.com) lately and they have ethernet modules,
serial libraries, etc.  All on a small small chip.  Well, the ethernet
is a daughter board, but they're still pretty small.  

Depends on how general purpose you need to make this device and what
you're trying to accomplish.  Maybe you need to give people a better
idea of what you're trying to do, instead of assuming you need Linux
and trying to shoe-horn it into a really tiny space.

Cheers,
John

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

* Re: linux kernel without file system
  2009-01-14 10:15 ` Alan Cox
@ 2009-01-15 15:34   ` Enrico Weigelt
  0 siblings, 0 replies; 22+ messages in thread
From: Enrico Weigelt @ 2009-01-15 15:34 UTC (permalink / raw)
  To: linux-kernel

* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

Hi,

> > Is there a way to access devices that does not require a file-system ?
> 
> No: but you can run with just your own programs and bits needed loaded
> off an initial ramdisk or a romfs image.

Well, it (IMHO) depends on what you call a filesystem. If you're 
talking about something that stores files (= byte streams with
some assigned name) on some medium, you *could* come around this
(in theory, no idea if it really makes sense): put everything you
need into one big static executable, let the bootloader load it
before the kernel is started (just like initrd ?) and hack up
the kernel to get that damn thing started. 

BUT: it you're talking about the VFS stuff - it's a fundamental
building block of the OS, required in many many places (from 
socket operations to kernel runtime config, ...) - if you *really*
want an OS w/o VFS, you better look at certain embedded-specific
OS'es ;-P

BTW: I'd really like to see much more things handled through the
filesystem (eg. networking API through some /net filesystem, like
on Plan9 ;-p) and let the dozens of syscalls, nelink socket, etc, 
etc die out.


cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------

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

* Re: linux kernel without file system
  2009-01-14 15:24             ` Philippe De Muyter
  2009-01-14 15:31               ` Rogan Dawes
@ 2009-01-15 18:06               ` Arnd Bergmann
  1 sibling, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2009-01-15 18:06 UTC (permalink / raw)
  To: Philippe De Muyter; +Cc: Rogan Dawes, Xavier Bestel, Tomasz Chmielewski, LKML

On Wednesday 14 January 2009, Philippe De Muyter wrote:
> if possible, mcf52236 (256k flash 32k sram in chip) :)
> 
> kernel+uapplication XIP in flash
> 
> they seems to push something called utasker

In 256kb it will be hard to even support simple user space.
One solution might be to just use linux as a library and
implement your application code in the kernel, inside
of the . That lets you throw out all system calls and some
of the init code of the kernel (don't call rest_init).

At that stage, you have lost most of the advantages of
using Linux over some other kernel.

	Arnd <><

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

* Re: linux kernel without file system
  2009-01-14 10:34     ` Kay Sievers
  2009-01-14 13:49       ` Xavier Bestel
@ 2009-01-17 19:38       ` Enrico Weigelt
  1 sibling, 0 replies; 22+ messages in thread
From: Enrico Weigelt @ 2009-01-17 19:38 UTC (permalink / raw)
  To: linux-kernel

* Kay Sievers <kay.sievers@vrfy.org> wrote:

> There are no device nodes in sysfs to talk to the device, only
> attributes, which are mostly plain small text files.

Actually, it would be really cool if all serial port operations
could be done via sysfs, so we don't need the device node 
(including all its ioctl()) at all.


BTW: did I already mention that I don't like ioctl() ?

cu
-- 
---------------------------------------------------------------------
 Enrico Weigelt    ==   metux IT service - http://www.metux.de/
---------------------------------------------------------------------
 Please visit the OpenSource QM Taskforce:
 	http://wiki.metux.de/public/OpenSource_QM_Taskforce
 Patches / Fixes for a lot dozens of packages in dozens of versions:
	http://patches.metux.de/
---------------------------------------------------------------------

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

end of thread, other threads:[~2009-01-17 19:40 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14  8:46 linux kernel without file system Tomasz Chmielewski
2009-01-14  9:34 ` Philippe De Muyter
2009-01-14  9:52   ` Xavier Bestel
2009-01-14 10:18     ` Philippe De Muyter
2009-01-14 14:27       ` Rogan Dawes
2009-01-14 14:52         ` Philippe De Muyter
2009-01-14 14:57           ` Rogan Dawes
2009-01-14 15:24             ` Philippe De Muyter
2009-01-14 15:31               ` Rogan Dawes
2009-01-15 18:06               ` Arnd Bergmann
2009-01-14 10:34     ` Kay Sievers
2009-01-14 13:49       ` Xavier Bestel
2009-01-17 19:38       ` Enrico Weigelt
2009-01-14 11:59   ` Arnd Bergmann
2009-01-14 12:18     ` Philippe De Muyter
2009-01-14 14:27   ` David Newall
2009-01-14 14:49     ` Philippe De Muyter
2009-01-14 15:14       ` David Newall
2009-01-14 17:02   ` John Stoffel
  -- strict thread matches above, loose matches on Subject: below --
2009-01-14  8:30 Philippe De Muyter
2009-01-14 10:15 ` Alan Cox
2009-01-15 15:34   ` Enrico Weigelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox