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

Why MBR copies itself to "0x0600"?

I have tried to study x86 MBR code as below: 0000:7C00 FA CLI 0000:7C01 33C0 XOR AX,AX 0000:7C03 8ED0 MOV SS,AX 0000:7C05 BC007C MOV SP,7C00 0000:7C08 8BF4 …
2
votes
0 answers

Cannot override more than 104KB of the MBR in Windows with C#

I was trying to override the MBR of my hard drive with an image. I wrote a C# program to do just that, and it worked, but it doesn't allow me to override more than ~104KB of the hard drive. The important data on this image was smaller that that, so…
Xyz
  • 212
  • 2
  • 9
2
votes
1 answer

bios int 0x13 fails without error

I'm writing a bootloader for educational use and it goes quit well. But when I tried to boot on a real machine my disk read code fails to load some sectors. No error code is given nor is the CF set. It also returns 1 in al which means that 1 sector…
Bietje
  • 51
  • 5
2
votes
1 answer

Filesystem on Loop Device not Recognized by Linux when Bootloader is Written to it

I am currently writing a bootloader in x86 NASM assembly designed to load a kernel (R.BIN) from a FAT16 filesystem and jump to it. I have been writing the bootloader to a blank image that I have mounted by using sudo losetup loop21 image.img. I…
House
  • 309
  • 3
  • 9
2
votes
1 answer

Phoenix BIOS skips MBR code, what is the ACTUAL BIOS standard?

I want to learn assembler to use the ultra-minimum bare code to get any x86 compatible machine running to display a hardcoded text on the screen on power on. I care about full compatibility with x86/IBM machines. I followed tutorials on simple…
2
votes
1 answer

Read string from harddrive and print to TTY option with assembly

I'm working on a "Write your own Operating System using assembly only by holding your hand along the way" project. I've written from scratch everything with the like of MikeOS with the exception of harddrive reading and writing. The importance of…
2
votes
0 answers

Call Grub (MBR) from Linux

I need an ASSEMBLER tool. I need to switch processor from protected mode to real mode. I need to copy the first 512 bytes of First Sector of first drive (it's an SSD now) to 0000:07c0 and JMP to that location. In effect I need to boot Grub2 from…
WinEunuuchs2Unix
  • 1,801
  • 1
  • 17
  • 34
2
votes
1 answer

why these real-mode code works in virtual machine but not working on my real machine?

I'm trying to write assemble code into mbr to use BIOS ISRs. I write the following code to the mbr, expecting the chars "ABCD" to be printed on the screen: mov ah,0x0e mov bp,0x8000 mov sp,bp push 'A' push 'B' push 'C' push 'D' mov al,…
social_loser
  • 143
  • 1
  • 6
2
votes
0 answers

Do modern operating systems ignore LBA/CHS information in the MBR boot sector?

I've wiped all the CHS/LBA information and bootcode on a spare flash drive leaving only the bare sector count information: 00000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000010 00 00 00 00 00 00 00 00 00 00 00 00…
Gala
  • 2,592
  • 3
  • 25
  • 33
2
votes
1 answer

Why is the first partition of an MBR set up on sector 63?

If I remember right, the first sector is the mbr and boot code, and when the XT first came out, DOS was placed right after the MBR and that landed the first partition at sector 63. I'm also remembering something about the first cylinder being…
stu
  • 8,461
  • 18
  • 74
  • 112
2
votes
1 answer

What's MBR offset 0x1C3 and how can I edit it?

I posted this question on another website but no one was able to help me there until a user suggested I posted this question here. So... My SSD has some trouble POSTING on my old GA-P35-DS3 motherboard if I try to use the Intel controller.…
2
votes
2 answers

Problem with stack based implementation of function 0x42 of int 0x13

I'm trying a new approach to int 0x13 (just to learn more about the way the system works): using stack to create a DAP.. Assuming that DL contains the disk number, AX contains the address of the bootable entry in PT, DS is updated to the right…
moongoal
  • 2,847
  • 22
  • 23
2
votes
2 answers

I failed in switching the cpu from real-mode to protected-mode

I do this according a book by Nick Blundell. I write a MBR program, which runs in real-mode firstly, and some instructions in the program will switch the cpu to protected-mode. First I set the GDT like this: gdt_start: gdt_null: dd 0x0 dd…
Akr
  • 179
  • 2
  • 4
  • 13
2
votes
2 answers

Open a binary file using vi and hexedit, why are the contents different?

I'm trying to edit a binary file directly and I know two editors, vi and hexedit. But when I open a binary file separately using them, the cotens are different. Below is what I did. First I use "dd if=/dev/sda of=mbr bs=512 count=1" to generate the…
Akr
  • 179
  • 2
  • 4
  • 13
2
votes
1 answer

Interpreting Bytes Per Sector on FAT32 Volume Boot Record

Below I've attached an image pertaining to the following question. I am parsing the volume boot record for a FAT32 partition and was stuck for many hours until I figured out WinHex has a Data Interpreter. When I click on 0Bh it shows a 16 bit…
Nick
  • 487
  • 1
  • 4
  • 21
1 2
3
9 10