Re: Serial Port access from kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 26, 2001 at 08:36:43PM +0530, Chirag Kantharia wrote:
> On Wed, Dec 26, 2001 at 03:40:32PM +0100, Erik Mouw wrote:
> | > Thanx for the reply. But, is there a way to invoke userland process
> | > without a filesystem?
> | No, but you'll need a filesystem anyway because otherwise the kernel
> | can't start init.
> 
> [Cc'ed to uclinux-dev since it's more relevant there]
> 
> Ok; I'll confess now. My problem, is that of loading a kernel image from
> a host pc into an embedded box. The flash on the embedded box's too less
> to fit in the kernel, with a filesystem.

How large is the flash? The smallest flash footprint I got on a
StrongARM system was about 1.5MB (128k bootloader, 512k kernel, 900k
rootfs), but I think I can fit it in 1MB when I make the bootloader
flash partition a bit smaller and use uClibc instead of glibc.

> So, I modified the init() function to load a kernel from the serial
> port, and write it to the RAM, which is quite in plenty. I'm expecting
> to be able to boot using the kernel image in the RAM, next.

What exactly is the target architecture?

> This might be incredibly stupid. I would like others to comment,
> especially, if there's a better way to do things. The embedded box's
> just got couple of serial ports and a couple of parallel ports.

I think you'd better use the bootloader to load the kernel over the
serial port.

I have written a bootloader for StrongARM systems (blob, see
https://sf.net/projects/blob/ ) which does exactly that. Normal use is
that the bootloader loads the kernel and an optional ramdisk from
flash, but you can download a kernel and a ramdisk over the serial port
in case you'd like to upgrade the kernel or the flash is too small.
This requires exactly 0 modifications to the kernel, and the code is
quite small (the bootloader flash footprint is 16k).

> I'm able to access the serial port using the serial port functions
> defined in the driver for serial port.

Sure, but it's all a bit of a hack; the bootloader is much better at
loading kernel and ramdisk images.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux