BOOT TIME - LINUXSHELL vs BOOTLOADER
Hi all
At boot time of the linux based target how is it determined which executable will run ? If I understood there are 2 methods BOOTLOADER and linux shell . Can you explain which to chose and how linux shell is written ? Thanks Elico |
Hmm.. I'm not sure what specifically it is that you want to know, but you could refer to these pages:
http://www.ibm.com/developerworks/li...y/l-linuxboot/ http://en.wikipedia.org/wiki/Linux_startup_process http://en.wikipedia.org/wiki/Init And according to one of those pages Quote:
|
Thnks
Great links. " invoke a simple shell script that starts the necessary embedded applications " How this shell is written , where in the on board linux file system it is loaded ? Elico |
Quote:
Or do you mean a real embedded system? I haven't seen one yet but I bet they depend on busybox. Just a guess. |
I am talking about a LINUX based embedded cared like HAWKBOARF for example.
In that case how the init shell is written ? What file extenssion ? Where in the file system is loaded ? Thanks Elico |
Quote:
Quote:
Btw, I guess you're not really using Linux right now are you? |
NO I do not
I want to clarify all issues before dive into this dep waters .. Elico |
Well sorry but I think the best way to understand it is to use it. I suggest you try setting up a low-level distro like Slackware or LFS. Being scared, too careful, or conservative about Linux won't help either.
|
Thanks
Elico |
From your question that is asking to distinguish between two completely different things, I think it would be useful to explain what those things are, and what their respective roles are.
A bootloader is the fist piece of code that runs on a newly booted host (except for a BIOS, in some cases). A bootloader is capable of loading an operating system. It may be very simple in nature, such as an MS-DOS bootloader, or complex and full featured such as grub or U-boot. The fact that some bootloaders have an interactive commandline feature makes some people think that they are using a commandline shell, like bash. Such is not the case, however, and in fact when a bootloader runs, there is no underlying OS (because of course, it is the bootloader's job to load the OS). A shell is a userspace application that runs by the graces of the underlying OS. In Linux, bash is the most common of these. A shell requires an OS to support it's functionality. Indeed, a shell is a way of exposing much of the OS kernel's functionality to the user. At boot-time, typically three different and distinct bits of code run. In order, the bootloader starts the process of booting, followed by the kernel which is loaded by the bootloader. The bootloader invokes the kernel by loading it into memory, and making a jump to the kernel entry point. The bootloader may set up a RAM-based filesystem for initial use by the kernel. The kernel then pokes around at some hardware and generally configures itself, and prepares to invoke the first userspace process. This first userspace process is called the init process. The name of said process may be hardwired into the kernel, or may be provided to the kernel by the bootloader. It is commonly a dedicated program that reads /etc/inittab, and uses the instruction found there to initialize the rest of the system (including mounting fileystems). It can be any program accessible by the kernel, and having sufficient resources to function on its own (usually meaning it is statically linked). Sometimes, the init process is simply a shell, or shell script. Always, the init process has PID=1, and is therefore the parent of all subsequent processes. My recommendation for exploring these elements is to set up a virtual machine to load a small simple SO such a TinyCore Linux. Then, you can explore and modify the init system (which I find to be quite elegant and simple), and learn the fundamentals. Doing so will teach you fundamentals that can be applied to both larger, more complex, traditional desktop/server systems, as well as scaled-down embedded systems. -- rod. |
Many thanks
Elico |
All times are GMT -5. The time now is 06:47 PM. |