Questions tagged [mbr]

Master Boot Record: the first sector on disk, containing partition info

A Master Boot Record (MBR) is a special type of boot sector at the very beginning of partitioned computer mass storage devices. The MBR holds the information on how the logical partitions, containing file systems, are organized on that medium.

It identifies how and where an operating system is located, so that it can be bootstrapped.

Wikipedia with full partition table info

136 questions
3
votes
0 answers

Why can't I print "Hello World" on the screen of the physical machine?

I wrote an MBR program: section MBR vstart=0x7C00 mov sp, $$ ; initialize register mov ax, 0 mov ds, ax mov es, ax mov ss, ax mov fs, ax ; Set the address of the video memory to the es segment register. mov ax,…
aszswaz
  • 609
  • 3
  • 10
3
votes
0 answers

Why I can directly run a binary file on the Real mode without using linkers?

My teacher asked me to write code into MBR of a virtual machine on a virtual box, I firstly use nasm to create a binary file, for instance, like this: nasm my_file.asm -o my_file.bin And I directly use dd command to write into the vhd: dd…
PoLomy
  • 31
  • 2
3
votes
1 answer

MBR organization

The field in the MBR partition table with 8 bytes offset is intended to store the LBA-address of the partition beginning. LBA addressing was introduced to address larger disks when there were not already enough CHS-coordinates. But at the time of…
D .Stark
  • 145
  • 11
3
votes
1 answer

Creating a FAT partition with a bootsector as an MBR

I am helping a friend write a bootloader for his operating system. I have gotten as far as writing a boot parameter block for him. It seems valid, however, when I use DD to burn it to the 1st sector of a 1.44MiB floppy disk image, it is not…
Safal Aryal
  • 155
  • 1
  • 8
3
votes
1 answer

USB hard disk emulation cause a disk read to fail (BIOS int 13)?

Some background: I'm working on a basic bootloader that reads a secondary bootloader into memory with the BIOS INT 13h AH=02h interrupt. I've got it working in the emulators (Virtualbox, Qemu, and Bochs). Subsequently, I added a BPB (BIOS…
travisjayday
  • 784
  • 6
  • 16
3
votes
1 answer

Extracting the MBR from a raspberry Pi

I tried extracting the MBR from my raspberry pi(with raspbian loaded on the SDCARD) as I would have with any Linux machine. dd if=/dev/ of=mbr.bin bs=512 count=1 However, upon doing a file on mbr.bin I get the following message :- mbr.bin:…
user277465
3
votes
4 answers

How to "read" the MBR (Master Boot Record) in C?

I just want to write a program to analyze MBR in C. I've known some ways to read it through APIs on Windows or commands on Linux. But, can I do it in C without any platform-dependent limitation? If I can't, is there any reason?
Kevin Dong
  • 5,001
  • 9
  • 29
  • 62
3
votes
2 answers

How to get the offset of a partition with a bash script?

I can use parted to find out the offset of my image. sudo parted -s image.img unit B print Model: (file) Disk /home/user/image.img: 107374182400B Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End …
adrelanos
  • 1,453
  • 2
  • 16
  • 27
3
votes
4 answers

Where to find the source code for a PC MBR Bootloader?

Preferably well comment and with some associated docmentation and a Makefile. Just for clearity, that's the less than 512 bytes (512 bytes - partition table) of machine code that gets loaded by the Bios and is responsible for chaining to the…
NoMoreZealots
  • 5,274
  • 7
  • 39
  • 56
2
votes
1 answer

Unable to find MBR type

I have this code which is part of a project source. This code finds the MBR type: GRUB or LILO, and accordingly sets a flag. Surprisingly in SLES 10-SP1 (SUSE Linux Enterprise Server), it is unable to determine. /dev/sda1 is my swap. /dev/sda2 is…
RajSanpui
  • 11,556
  • 32
  • 79
  • 146
2
votes
1 answer

How to use debug.exe to load a flash drive [ pendrive ] and view its boot record?

The drive letter if F, and i want to read its boot record for this task : http://joelgompert.com/OS/lesson1.htm ... [ i am using xp ] I cant get the l command to work properly... when they ask us to type this is debug.exe : -l 0 0 0 1 I replaced…
Rohan Bojja
  • 655
  • 1
  • 16
  • 35
2
votes
1 answer

Difference between boot0.S and mbr.S in FreeBSD

I'm reading source code of FreeBSD and found that they have 2 files which may be used to create MBR - sys/boot/i386/boot0/boot0.S and sys/boot/i386/mbr/mbr.S. From current my understanding boot0.S is the code in MBR (first sector of boot disk drive…
Shu Suzuki
  • 1,164
  • 11
  • 19
2
votes
1 answer

How to use PowerShell to detect unallocated space on a MBR disk?

I am currently facing an issue with one of my MBR disks on a Windows server. The disk is supposed to have a maximum size of 2048GB, but I have noticed that there is additional space allocated to it from the storage end. After checking the disk, I…
Fajela Tajkiya
  • 629
  • 2
  • 10
2
votes
0 answers

What is in the "bootstrap code area" in a modern MBR?

I'm reading the wikipedia article on Master Boot Record and specifically curious about what (if anything) needs to be in the "bootstrap code area" for the MBR to be readable in modern systems. I used parted to create an MBR on an SD card then used…
thom_nic
  • 7,809
  • 6
  • 42
  • 43
2
votes
0 answers

Why is the string split when outputting ASCII strings in MBR?

In the MBR program, the following code is used to print "Hello world" to the screen: section MBR vstart=0x7C00 mov sp, $$ ... ; Set the memory address of the graphics card to the ES register. mov ax, 0xB800 mov es, ax ... …
aszswaz
  • 609
  • 3
  • 10
1
2
3
9 10