Questions tagged [bootloader]

Bootloader is a program that loads the operating system into the computer's memory and set it into execution. When a computer is powered-up or restarted, the basic input/output system (BIOS) performs some initial tests, and then transfers control to the Bootloader.

A computer's central processor can only execute program code found in read-only memory (ROM), random access memory (RAM). Modern operating systems and application program code and data are stored on nonvolatile data storage devices, such as hard drives, CD, DVD, flash memory cards (like an SD card), USB flash drive, and floppy disk.

When a computer is first powered on, it usually does not have an operating system in ROM or RAM. The computer must execute a relatively small program stored in ROM along with the bare minimum of data needed to access the nonvolatile devices from which the operating system programs and data are loaded into RAM.

The small program that starts this sequence of loading into RAM is known as a bootstrap loader, bootstrap or boot loader. This small boot loader program's only job is to load other data and programs which are then executed from RAM. Often, multiple-stage boot loaders are used, during which several programs of increasing complexity sequentially load one after the other in a process of chain loading.

1763 questions
11
votes
1 answer

Grub bootloader with shared library support

I'd like to load a shared library (closed-source binary user-space library) at boot stage with grub boot-loader. Are there any chances for this or I must write a custom-elf-loader (grub module) to do it? 29/08/2014: For more detail, this is a…
tuantm
  • 341
  • 1
  • 10
11
votes
2 answers

Bootloader for Cortex M3

I am using a LPC 1768 board from mbed, (with cortex M3 cpu) and I am trying to achieve something here, mainly upgrade the user application from the SD Card, I am writing two programs, first a bootloader/nano-kernel, and a user-app (helloworld will…
batmat
  • 225
  • 1
  • 5
  • 17
10
votes
1 answer

Run a UEFI shell command from inside UEFI application

I'm new to UEFI application development. My requirement is that, I need to run an UEFI shell command from my UEFI application (app.efi) source code. Need guidance on how I can do this. Example, cp command in UEFI shell is used to copy a file from…
Keshava GN
  • 4,195
  • 2
  • 36
  • 47
10
votes
1 answer

Where is there good information about low level PC booting?

I'm interested in writing a boot loader for USB sticks that looks for a directory of ISOs and gives you the option to boot one of them as if it were a bootable CD. This is basically so I have a menu driven program that allows me to install one of…
Omnifarious
  • 54,333
  • 19
  • 131
  • 194
10
votes
1 answer

how to build grub2 bootloader from it's source and test it with qemu emulator

I want to know how to build grub 2 bootloader from it's source in ubuntu and test it with qemu emulator. I would also like to change the default background image of grub2 bootloader in the new build? Is this possible? If yes, how ?
Project-A
  • 133
  • 1
  • 2
  • 12
10
votes
3 answers

what is the need of second stage boot loader ? why different bootloaders like first stage and second stage?

I know the first stage boot loader will make basic hardware initializations and calls the second stage boot loader like u-boot. But I still do not understand for why we need multiple stages of boot loaders. Why can't we have only one boot loader,…
Pradeep G
  • 111
  • 1
  • 1
  • 5
10
votes
3 answers

How to load second stage boot loader from first stage?

I have written simple first stage bootloader which displays "Hello world" using interrupt to bios. Now as a next obvious step to write a second stage, but where code for that should exist and how to load it from first stage ? Here is a program for…
Xinus
  • 29,617
  • 32
  • 119
  • 165
10
votes
4 answers

My bootloader can't be compiled with gcc 4.6 and 4.7 ... only 4.5

I created my bootloader before 2 years under debian squeeze/stable with gcc 4.5. Now in debian wheezy/sid can't be compiled with 4.6 and 4.7 because creates bigger sections from these i expecting to produce the final binary by hand. This is not…
Memos Electron
  • 660
  • 5
  • 26
9
votes
2 answers

How would I write a bootloader to load a c kernel?

I am learning NASM as I write bootloaders. So far I have a hello world bootloader. I want to know how to link a c program to it and have the bootloader load it into memory and start executing it's entry point function. I need NASM code as I am a…
user701329
  • 127
  • 2
  • 7
9
votes
1 answer

Intel hex format and position independent code using gcc

I'm not sure if this is specific to the processor I'm using, so for what it's worth I'm using a Cortex M0+. I was wondering: if I generate a hex file through gcc using -fPIC, I produce...Position Independent Code. However, the intel hex file…
Michael Stachowsky
  • 717
  • 1
  • 5
  • 21
9
votes
1 answer

Using db to declare a string in assembly NASM

I am following a tutorial to write a hello world bootloader in assembly and I am using the NASM assembler for an x-86 machine. This is the code I am using : [BITS 16] ;Tells the assembler that its a 16 bit code [ORG 0x7C00] ;Origin, tell the…
Neeraj
  • 137
  • 1
  • 2
  • 9
9
votes
4 answers

How do I write a bin file (512 bytes) to the first sector (sector 0) of a floppy disk?

How do I write a .bin file to be in the first sector of a floppy disk/virtual floppy disk/floppy image? I'm trying to boot a simple 512-byte bootloader. The size on everywhere says "512 bytes" so I should be good already. Additional Information: The…
Star OS
  • 119
  • 1
  • 1
  • 15
9
votes
1 answer

Stack segment in the MikeOS bootloader

I don't understand this piece of code: mov ax, 07C0h ; Set up 4K of stack space above buffer add ax, 544 ; 8k buffer = 512 paragraphs + 32 paragraphs (loader) cli ; Disable interrupts while changing stack mov ss, ax mov sp,…
qik
  • 750
  • 8
  • 14
9
votes
3 answers

How to step over interrupt calls when debugging a bootloader/bios with gdb and QEMU?

For educational purposes, I have adapted this bootloader from mikeos.berlios.de/write-your-own-os.html rewriting it to specifically load at address 0x7c00. The final code is this: [BITS 16] ; Tells nasm to build 16 bits code [ORG 0x7C00] …
Cesar Brod
  • 320
  • 3
  • 13
9
votes
3 answers

which core initializes first when a system boots?

I want to know which core of a multicore processor initializes first when the cpu boots ? ( i mean at the bootloader level ) is the first core ? or random core ?
Knight Rider
  • 123
  • 1
  • 6