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
9
votes
1 answer

PC boot: dl register and drive number

I read somewhere in the internet that, before jumping to 0x7c00, the BIOS loads into %dl the "drive number" of the booted device. But what is this "drive number"? Each device attached to the computer is assigned a number by the BIOS? If so, how can…
KevinRGT
  • 389
  • 2
  • 5
  • 14
8
votes
1 answer

Custom bootloader issues

Im trying to write a bootloader for a Hobby OS and have it working great. Nothing Special, just prints a line of text: BITS 16 ORG 0 start: jmp main OEM db "Test OS " BytesPerSector: DW 512 SectorsPerCluster: DB…
Chase Walden
  • 1,252
  • 1
  • 14
  • 31
8
votes
3 answers

How to make an bootable iso(not cd or flash drive) for testing your own boot loader?

i am trying to write a boot loader(hello world sort). i am using Bochs for simulation (platform Linux-Ubuntu). But i am unable to make an bootable iso for my binary file. Though in tutorial VFD(virtual floppy disk) is used but it is for windows…
Terminal
  • 1,969
  • 5
  • 21
  • 37
8
votes
1 answer

How can linux boot code be written in C?

I'm a newbie to learning OS development. From the book I read, it said that boot loader will copy first MBR into 0x7c00, and starts from there in real mode. And, example starts with 16 bit assembly code. But, when I looked at today's linux kernel,…
8
votes
0 answers

Code to test if Android bootloader is unlocked?

Is there a way to check in code whether or not a device's bootloader has been unlocked? Not whether the devices is rooted, just the bootloader status. There's this command of course: fastboot oem device-info But I need to be able to make the same…
Bungles
  • 1,969
  • 2
  • 25
  • 54
8
votes
1 answer

Remotely Updating Raspberry Pi Software 'over the air'

We use a Raspberry Pi embedded computer to connect IP cameras on a customers network to our cloud based recording service. We are using Raspbian and about 50% are Wheezy and 50% are Jessie. The challenge we have is how to remotely update the…
dopey
  • 496
  • 1
  • 6
  • 19
8
votes
2 answers

How to switch from real mode to protected mode after bootloader?

I just finished up a very bare-bones bootloader for my OS and now I'm trying to switch to protected mode and jump to the kernel. The kernel exists on the second sector (right after the bootloader) and on. Can anyone help me out with my code? I…
David
  • 693
  • 1
  • 7
  • 20
8
votes
1 answer

Near call/jump tables don't always work in a bootloader

General Problem I've been developing a simple bootloader and have stumbled on a problem on some environments where instructions like these don't work: mov si, call_tbl ; SI=Call table pointer call [call_tbl] ; Call print_char using near…
Michael Petch
  • 46,082
  • 8
  • 107
  • 198
8
votes
2 answers

understanding nasm assembly for outputting characters in teletype mode

I am reading this wonderful skript on operating system programming http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf On Page 12 there is a simple bootloader. If I understand correclty, the code shown is what you must write in…
user3813234
  • 1,580
  • 1
  • 29
  • 44
8
votes
2 answers

uEnv.txt vs boot.scr

I'm very confused on these two files for the boot configuration. They seem to be doing the same thing and I don't understand why I would need either or. If I use uEnv.txt, I set it as bootargs=console=ttyS0,115200 root=/dev/mmcblk0p2 rootwait…
Kousha
  • 32,871
  • 51
  • 172
  • 296
8
votes
2 answers

Why test port 0x64 in a bootloader before switching into protected mode?

In my MIT OS course (686) I have found some code that I don't understand. I'm trying to understand the instruction inb $0x64, %al in boot/boot.S. My understanding is that it's reading one byte from data port 0x64 into AL, What is port 0x64? Which…
Mike
  • 1,841
  • 2
  • 18
  • 34
8
votes
4 answers

GCC, ARMboot - Creating standalone application without any library and any OS

I have an embedded hardware system which contains a bootloader based on ARMboot (which is very similar to Uboot and PPCboot). This bootloader normally serves to load uClinux image from the flash. However, now I am trying to use this bootloader to…
psihodelia
  • 29,566
  • 35
  • 108
  • 157
8
votes
3 answers

Why Does the BIOS INT 0x19 Load Bootloader at "0x7C00"?

As we know the BIOS Interrupt (INT) 0x19 which searches for a boot signature (0xAA55). Loads and executes our bootloader at 0x7C00 if it found. My Question : Why 0x7C00? What is the reason ? How to evaluate it through some methods?
Gapry
  • 253
  • 1
  • 7
  • 20
8
votes
4 answers

Read a write a sector from hard drive with int 13h

I have a simple program. It must read first sector from hard drive (not mbr), and write it to the 0 sector (mbr). But it doesnt work. I think it is connected with wrong DAP. Thanks. [bits 16] [org 0x7c00] ;clear screen start: mov …
Vanzef
  • 453
  • 1
  • 5
  • 17
7
votes
2 answers

Bootloader Strange Behavior

I have been trying to design a simple OS, just the boot sector, and 16-bit real mode with interrupts. I have finally been able to make the OS / bootloader, that I tested in virtual box, and it worked. I then burned the image to a CD, and booted it…
codesmith
  • 561
  • 1
  • 3
  • 17