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
16
votes
2 answers

x86 NASM 'org' directive meaning

I am following this tutorial as a first foray into bootloader/OS development for x86 using NASM: http://joelgompert.com/OS/TableOfContents.htm And I'm on Lesson 4, which is making my bootloader print the "Hello, world" string. I'm not understanding…
tdenniston
  • 3,389
  • 2
  • 21
  • 29
15
votes
1 answer

Debugging bootloader with gdb in qemu

There seems to be a problem with the Freedos bootloader. (It appears that the bootcode can't find the kernel in certain circumstances.) So I'm trying to debug the bootloader in qemu with gdb. Following the instructions found on several wiki and…
rhlee
  • 3,857
  • 5
  • 33
  • 38
14
votes
4 answers

ADB Fastboot error when flasing rom 'FAILED remote unknown command'

I'm trying to flash Google factory image file on nexus 6P but it always stops at the same point. USB debugging is enabled, MTP mode also. Bootloader is unlocked and communicating with ADB Fastboot etc, is there something I'm missing? I've downloaded…
Zach89
  • 183
  • 1
  • 1
  • 8
14
votes
2 answers

Custom bootloader booted via USB drive produces incorrect output on some computers

I am fairly new to assembly, but I'm trying to dive into the world of low level computing. I'm trying to learn how to write assembly code that would run as bootloader code; so independent of any other OS like Linux or Windows. After reading this…
Austin Fay
  • 500
  • 3
  • 16
14
votes
3 answers

Difference between bootloader and bootstrap loader?

how boot loader is different from bootstrap loader. According to me bootstrap loaders are stored in ROM and boot loaders are in hard disk in MBR (please correct me if I am wrong). bootstrap loader is the first program which get executed after…
alice
  • 141
  • 1
  • 2
  • 6
14
votes
2 answers

ARM bootloader: Interrupt Vector Table Understanding

The code following is the first part of u-boot to define interrupt vector table, and my question is how every line will be used. I understand the first 2 lines which is the starting point and the first instruction to implement: reset, and we define…
user2122968
14
votes
1 answer

How does Raspberry Pi's boot loader work?

Recently I started to study about Embedded System and Embedded Linux. I know that in an embedded system, the operating system is stored on Flash or ROM. When it's turned on, the bootloader loads the operating system into main memory, and with a…
Heewon Hwang
  • 297
  • 2
  • 3
  • 9
13
votes
2 answers

How can i put a compiled boot sector onto a USB stick or disk?

I'm actually interested in how an OS works, from the POST over the Boot process to the Kernel, GUI, etc. Well I have to start at the beginning: The bootsector Most tutorials only specify how to get your .bin bootstrapper onto an USB stick for Linux…
orossum
  • 133
  • 1
  • 4
13
votes
1 answer

Why 55 AA is used as the boot signature on IBM PCs?

Why does the IBM PC architecture use 55 AA magic numbers in the last two bytes of a bootsector for the boot signature? I suspect that has something to do with the bit patterns they are: 01010101 10101010, but don't know what. My guesses are…
SasQ
  • 14,009
  • 7
  • 43
  • 43
12
votes
2 answers

Page number in BIOS interrupts

I'm building a small bootloader for x86 as a project. For the moment I'm writing several functions to handle the screen, since it's a bit tedious. Most BIOS interrupt functions involve a page number argument, and I can't tell what this is…
Guido
  • 2,571
  • 25
  • 37
12
votes
4 answers

How does the bootloader pick up the command after a "restarting system with command"?

Looking in the android source for the reboot command we find the following line: __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2, \ LINUX_REBOOT_CMD_RESTART2, argv[optind]); Which is the standard Linux system call to reboot the system…
Bjarke Freund-Hansen
  • 28,728
  • 25
  • 92
  • 135
12
votes
1 answer

Far jump in gdt in bootloader

flush_gdt: lgdt [gdtr] jmp 0x08:complete_flush complete_flush: mov ax, 0x10 mov ds, ax mov es, ax mov fs, ax mov gs, ax mov ss, ax ret I am unable to understand what this code does . flush_gdt is a label okay ,…
abkds
  • 1,764
  • 7
  • 27
  • 43
11
votes
4 answers

How do I run linux on an ARM Cortex M3 board?

I have a Luminary LM3s8962 ARM Cortex M3 development board, and while I've been able to program for it using the Keil RTOS, I'd much prefer to develop on top of linux and an embedded libc. What I would like to know is how can I actually get a linux…
wooster
  • 111
  • 1
  • 1
  • 3
11
votes
1 answer

Disk Read Error while loading sectors into memory

I tried to develop a bootloader using this, but when it is run it shows: disk read error! If I ignore it, in a later part, it shows me wrong memory mapping. I also followed some other sources too but in vain. It feels like I'm just copying what…
Palvit Garg
  • 137
  • 2
  • 9
11
votes
1 answer

How to make the kernel for my bootloader?

I'm trying to make my own custom OS and I need some help with my code. This is my bootloader.asm: [ORG 0x7c00] start: cli xor ax, ax mov ds, ax mov ss, ax mov es, ax mov [BOOT_DRIVE], dl mov bp, 0x8000 mov sp, bp …