LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices

Reply
 
Search this Thread
Old 01-05-2011, 05:24 AM   #1
P5music
Member
 
Registered: Nov 2010
Posts: 59

Rep: Reputation: 0
embedding in common PC hardware


Hi,
I am looking for your help to find out this information.
Has anyone embedded linux in a common PC hardware, that is chosen what devices it has on, everything is compiled and tweaked for only these devices and no useless operation is done at boot (init stuff)?
Could I find some documentation about this project or possibility, if any?
Thanks
 
Old 01-05-2011, 10:11 PM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
It sounds like you are just talking about a minimal Linux system with a optimized and hardware-tailored kernel. That is easy to do, and some distributions (LFS comes to mind) make it fairly straightforward. The small, optimized, OS can then be booted from a CF card or similar arrangement.
 
Old 01-06-2011, 09:48 AM   #3
P5music
Member
 
Registered: Nov 2010
Posts: 59

Original Poster
Rep: Reputation: 0
What would be the main advantage of this kind of hardware-taylored system? OK if it's reduced boot time because I am interested in ultra-fast boot.
I read the LFS book but there's not that kind of information. However I cannot compile everything in a system, I want just to edit kernel and scripts.
So I think I need a project that was already made by someone to study it.
 
Old 01-06-2011, 10:15 AM   #4
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Hello,

I agree with MS3FGX, if you really want to fine tune the whole system, a LFS based system is probably the best alternative. The drawbacks is that you will have to spend a lot of time to configure each packages and it does not have any package manager
Another good alternative may be Gentoo. Its portage system is really awesome when you master... but you will have a long learning curve for that. Gentoo advantages is that you can choose everything, for example which package for boot process (upstart, standard sysv, systemd, openrc, or something else...). You can also choose which support to enable for each package, for example, you know that you will never use ipv6 or gnome, well each package having option/dependency related to ipv6 or gnome will be compiled without this kind of support. Also you will be able to fine tune compilation by telling portage system to compile each package with the best gcc options for your architecture.
Anyway considering your requirements, if you really want a real fast boot and fined tuned sytem, you will have to spend a lot of time.

Kind regards,

Oliv'
 
Old 01-06-2011, 10:24 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,580
Blog Entries: 2

Rep: Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037
What type of system do you actually want to build? Ordinary desktop? Fileserver? Any other device?
 
Old 01-06-2011, 10:39 AM   #6
P5music
Member
 
Registered: Nov 2010
Posts: 59

Original Poster
Rep: Reputation: 0
Please take a look at the following:
Code:
[    0.272718] Trying to unpack rootfs image as initramfs...
[    0.483556] Freeing initrd memory: 8241k freed

[    0.886042] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    3.897038] floppy0: no floppy controllers found

[    3.898416] Probing IDE interface ide0...
[    4.433376] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

[    4.433481] Probing IDE interface ide1...
[    4.966706] ide1 at 0x170-0x177,0x376 on irq 15

[    7.744081] Adding 760844k swap on /dev/ramzswap0.  Priority:-1 extents:1 across:760844k SS
[   10.725731] scsi 6:0:0:0: Direct-Access     Generic- Multi-Card       1.00 PQ: 0 ANSI: 0 CCS

[   10.730078] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[   11.294334] scsi 7:0:0:0: Direct-Access     Generic  USB SD Reader    

[   11.296234] sd 7:0:0:1: Attached scsi generic sg4 type 0
[   11.963721] sd 7:0:0:1: [sdd] Attached SCSI removable disk

[   11.972410] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[   16.856770] generic-usb 0003:14AA:0226.0001: timeout initializing 

[   17.011500] generic-usb 0003:062A:0000.0002: input: USB HID v1.10 Mouse [HID 062a:0000] on usb-0000:00:1d.7-1.4/input0
[   18.030920] sky2 eth0: enabling interface
it's excerpts from dmesg output (printk.time=1 option)

I read many documents about init process and I think this output is from modules.
I chose the lines where a big delay was encountered to show you. I don't know if it has to be blamed on the first line or the second, and I don't know if that time is printed at the beginning or at the end of the module execution. I don't even know what module it is from (I try with grep but it seems to be difficult).
But I want to reduce that time. I absolutely need to know how.
 
Old 01-06-2011, 10:59 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,580
Blog Entries: 2

Rep: Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037
This modules are actually probing your hardware. You do have a multi-card-reader? That is the one that is actually probed there (amongst others). You can of course compile a kernel that contains only the modules you need, but I don't think that it will really speed up your boot. Loading modules is only a part of it, you also have to start daemons, initialize the network, and, and, and.
May be you are beginning from the wrong point. The fastest booting is that, that actually didn't take place. I almost never really boot, I almost always set my system up to suspend (most of the time) or hibernate (if I am longer away from home). This way, normally I get "boot times" <2s (suspend), and when coming home from longer absence, I don't know for sure, but I think it is less than 15s, including BIOS post.
 
Old 01-06-2011, 11:21 AM   #8
P5music
Member
 
Registered: Nov 2010
Posts: 59

Original Poster
Rep: Reputation: 0
The point is: the system never changes and never breaks so what do the modules probe?
I want to edit the modules code so they just load some register and the address of the device. I think it can be done and maybe someone did it. if not, I would like to know how to do.
 
Old 01-06-2011, 11:35 AM   #9
Oliv'
Senior Member
 
Registered: Jan 2004
Location: Montpellier (France)
Distribution: Gentoo
Posts: 1,014

Rep: Reputation: 36
Ok so what you want is probably that: http://elinux.org/Deferred_Initcalls (and probably also some other customizations)
Also have a look to other pages on this site... many of them are really really interesting

Kind regards

Oliv'
 
Old 01-06-2011, 12:47 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,580
Blog Entries: 2

Rep: Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037Reputation: 4037
Maybe I am wrong here, and please anyone correct me if so. The modules for embedded devices are very special, I would believe, while the modules for ordinary PC-hardware are for a much broader range of devices. That means, that a module can drive more than one piece of hardware, for example like the snd_hda_intel-module. So in any way it has to probe which hardware exactly is in the system, even if the hardware has not changed.
But this are only my , maybe I am just plain wrong here.
 
Old 01-06-2011, 01:54 PM   #11
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Well, technically, by the time you see all of those messages, the system is booted. Loading modules is done by userspace applications such as modprobe and once userspace applications have started, the system is booted. You could build modules into the kernel, or delay loading of the modules if you need some other actions to start earlier. The init process is where you need to focus to modify this behavior. On hardware that I work with (ARM), a busybox shell is loaded in userspace in about 2 seconds following reset/power-on. The entire application can be embedded in an initrd, and launched by the kernel before any spinning media (if it even exists) ever sees a probe or a prod.
A lot of the probing and delays that are part of device driver initialization is to accommodate things like Plug & Play compatible devices. Linux desktop and server oriented installations are geared to be generic enough that they can accommodate various hardware configurations and respond to changes in hardware configuration. When I think about embedded systems, I think exactly the opposite: exactly enough hardware and software to accomplish the one job that the system is required to perform. Reduce everything to the minimum footprint.

--- rod.
 
1 members found this post helpful.
Old 01-06-2011, 02:22 PM   #12
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
Quote:
Originally Posted by TobiSGD View Post
Maybe I am wrong here, and please anyone correct me if so. The modules for embedded devices are very special, I would believe, while the modules for ordinary PC-hardware are for a much broader range of devices.
Well, the kernel in a desktop distribution would include modules for more devices, while an embedded device would have a set hardware configuration, but there is no fundamental difference between the two. You can just as easily compile in all the drivers your desktop needs and not use any modules at all, which in fact is what I do on my machines since I don't change my hardware very often.

Last edited by MS3FGX; 01-06-2011 at 02:23 PM.
 
Old 01-07-2011, 03:03 AM   #13
cnxsoft
Member
 
Registered: Nov 2010
Location: Thailand
Distribution: Fedora 12, Ubuntu 10.10
Posts: 166

Rep: Reputation: 29
You could try to disable floppy support, swap and USB mass storage support if you don't need those.
Alternatively it might be possible to compile those as modules, so that you load them after your system is booted.

Quote:
Originally Posted by P5music View Post
Please take a look at the following:
Code:
[    0.272718] Trying to unpack rootfs image as initramfs...
[    0.483556] Freeing initrd memory: 8241k freed

[    0.886042] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    3.897038] floppy0: no floppy controllers found

[    3.898416] Probing IDE interface ide0...
[    4.433376] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14

[    4.433481] Probing IDE interface ide1...
[    4.966706] ide1 at 0x170-0x177,0x376 on irq 15

[    7.744081] Adding 760844k swap on /dev/ramzswap0.  Priority:-1 extents:1 across:760844k SS
[   10.725731] scsi 6:0:0:0: Direct-Access     Generic- Multi-Card       1.00 PQ: 0 ANSI: 0 CCS

[   10.730078] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[   11.294334] scsi 7:0:0:0: Direct-Access     Generic  USB SD Reader    

[   11.296234] sd 7:0:0:1: Attached scsi generic sg4 type 0
[   11.963721] sd 7:0:0:1: [sdd] Attached SCSI removable disk

[   11.972410] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[   16.856770] generic-usb 0003:14AA:0226.0001: timeout initializing 

[   17.011500] generic-usb 0003:062A:0000.0002: input: USB HID v1.10 Mouse [HID 062a:0000] on usb-0000:00:1d.7-1.4/input0
[   18.030920] sky2 eth0: enabling interface
it's excerpts from dmesg output (printk.time=1 option)

I read many documents about init process and I think this output is from modules.
I chose the lines where a big delay was encountered to show you. I don't know if it has to be blamed on the first line or the second, and I don't know if that time is printed at the beginning or at the end of the module execution. I don't even know what module it is from (I try with grep but it seems to be difficult).
But I want to reduce that time. I absolutely need to know how.
 
Old 01-07-2011, 08:54 AM   #14
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,395
Blog Entries: 2

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
P5music, what do you want your embedded system to do, specifically? Do you already have some/most/all of an application or suite of applications that need to run? What hardware driver support does your application(s) require?
To get the fastest boot time, you should launch your application(s) directly from a RAM disk that is built into the kernel image (initrd), and the required driver(s) should be built into the kernel. In a traditional desktop or server oriented system, there is an init process that launches driver loaders, like modprobe, and performs a lengthy configuration process. The init process is identified to the kernel via kernel arguments (supplied by the bootloader), or may be built into the kernel. The init process can be anything you want, and you can simply roll your own. I think it needs to be statically linked, but otherwise it can be any program you want, or write. Given the circumstances around how it is loaded, it may need to do some extra work to initialize the system to a point that it can operate. Those are details that are specific your application and hardware architecture.
If you are using a traditional PC host platform, you will always get delays related to the BIOS initialization procedure. This too, can be minimized. If you have a host architecture that allows for BIOS extension ROMS, these will be identified early on by the BIOS, and invoked at an early stage in the boot process. They can be used to bootstrap your OS without delay, and using whatever means is appropriate to your application. PXE boot ROMs that are installed on ethernet adapters are a good example of this technology. There is nothing to say that such a BIOS extension ROM on an ethernet adapter has to use the ethernet; it can do whatever you want it to (you just have to write the code...).
By nature, embedded systems have very specific purposes, and it is difficult to guide you without some details of what your application needs to do, what your requirements are, and what hardware is involved.

--- rod.

Last edited by theNbomr; 01-07-2011 at 08:55 AM.
 
Old 02-21-2011, 10:23 AM   #15
gr8scot
Member
 
Registered: Jun 2007
Distribution: Debian
Posts: 73

Rep: Reputation: 16
I apologize in advance for having no answers to any follow-up questions.

I just don't follow this subject closely. But I did recently note, with passing curiosity
http://bootdebian.blogspot.com/

which looks possibly like it has at least the general type of information you're after.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xfree86-common xserver-common xfonts-base missing in etch/lenny unev_21 Debian 2 09-11-2009 02:12 AM
BOGUS.common.04y -> /home/common/Mailbox jayakrishnan Linux - Networking 0 11-19-2005 04:48 AM
embedding a command for at? Xstack Linux - General 2 02-21-2005 03:42 PM
Why can't a common hardware driver format/system be developed? oudent Linux - General 6 02-01-2004 11:08 PM
Hardware clock - common problem NSKL Slackware 5 01-09-2003 09:18 AM


All times are GMT -5. The time now is 11:29 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration