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
101
votes
7 answers

How do I disassemble raw 16-bit x86 machine code?

I'd like to disassemble the MBR (first 512 bytes) of a bootable x86 disk that I have. I have copied the MBR to a file using dd if=/dev/my-device of=mbr bs=512 count=1 Any suggestions for a Linux utility that can disassemble the file mbr?
sigjuice
  • 28,661
  • 12
  • 68
  • 93
15
votes
11 answers

Write MBR Code

I am an electrical engineer who has recently discovered the need to modify the code in the MBR. Basically I need the ability to execute code on the HDD before, the OS starts up and takes over. I fully understand that this will need to be written in…
Chris
13
votes
3 answers

What information does BIOS load into RAM?

I know that, on booting, BIOS loads the first sector (512 bytes) of a pre-defined device drive on memory 0x7c00 and then jump to that address. So, memory from 0x7c00 to 0x7dff is occupied. Is there any other section of RAM that is occupied? If I'm…
Elabra Sanchez
12
votes
10 answers

How to tell which disk Windows Used to Boot

I'm need to find a method to programmatically determine which disk drive Windows is using to boot. In other words, I need a way from Windows to determine which drive the BIOS is using to boot the whole system. Does Windows expose an interface to…
Terry
  • 581
  • 3
  • 9
  • 17
10
votes
3 answers

Calculate Minimum Bounding Rectangle Of 2D Shape By Coordinates

I have a solution that uses spatial data to represent a cluster of points on a map. I have the need to used the coordinates that represent the extents of a cluster to find the minimum bounding rectangle that can contain said cluster of points. Does…
CSharpened
  • 11,674
  • 14
  • 52
  • 86
7
votes
3 answers

Modifying the MBR of Windows

I need to modify the MBR of Windows, and I would really like to do this from Windows. Here are my questions. I know that I can get a handle on a physical device with a call to CreateFile. Will the MBR always be on \\.\PHYSICALDRIVE0? Also, I'm still…
Terry
  • 581
  • 3
  • 9
  • 17
7
votes
1 answer

How can i find the MBR sector in a VMDK file?

I'm trying to understand how the vmware bios finds the MBR before it loads it. In physical Hard disks it's easy - the MBR sits at the first sector. But .. what happens in VM's? I created 2 VM's - In the first vmdk (with a linux-based system…
Avraham Shalev
  • 170
  • 1
  • 9
6
votes
1 answer

bootloader works in qemu but fails in virtualbox and on hardware

my bootloader consists of two 512 byte stages. stage 1 gets loaded by the bios into the MBR area. stage1 then proceeds to load stage2 from the drive and jumps to it. i confirmed with a hex editor that the size of final binary "program.bin" is…
Oachkatzl
  • 307
  • 1
  • 11
6
votes
4 answers

Detect GPT and MBR partitions with Powershell

Is there a way to tell if a disk has a GPT or an MBR partition with powershell?
Josh
  • 2,259
  • 4
  • 22
  • 25
6
votes
2 answers

Writing bootsector in C: prevent generating stack pointer initialization

After tinkering with writing bootsector code in assembly, I'm wondering if I can do the same but in C. So far the code generation in an empty function looks as such: in C: void _start() { halt: goto halt; } consequent asm (generated by…
Maxim Blinov
  • 886
  • 9
  • 33
5
votes
1 answer

BIOS Disk - Read Sectors Into Memory (int 0x13, ah=0x02) blocking

I am writing a MBR and using QEMU for testing. When using read sectors into memory (int 0x13, ah=0x02), the int instruction seems to block execution of my program, and it proceeds to hang. I have tested this with various print statements to confirm…
Stewart Smith
  • 1,396
  • 13
  • 28
5
votes
4 answers

What Assembly Instructions Live In the Master Boot Record?

Curious about what explicit assembly instructions actually make up the Master Boot Record on an X86 architecture. Thanks for any insights. Other architectures welcome, but this is primarily for X86.
iokevins
  • 1,427
  • 2
  • 19
  • 29
4
votes
5 answers

Low-Level-Writing in C

How can I write to any block on my HDD using the C programming language? There was a question about writing the MBR but it didn't cover the C aspects that much. Since filedescriptors are - as the word says - for files, I guess there is no way to use…
markusschmitz
  • 676
  • 5
  • 18
4
votes
3 answers

c++ execute code from no file system

First of all, had a hard time figuring out a title, and it's a bit ambiguous, but oh well. Alright, so I have a mixed c++ & asm bootloader program. I can copy it onto my mbr and run it. The only problem I'm having is the fact that the mbr is very…
Kelly Elton
  • 4,373
  • 10
  • 53
  • 97
4
votes
2 answers

FASM vc MASM trasnlation problem in mov si, offset msg

just did my first test with MASM and FASM with the same code (almos) and I falled in trouble. The only difference is that to produce just the 104 bytes I need to write to MBR in FASM I put org 7c00h and in MASM 0h. The problem is on the mov si,…
Ruben Trancoso
  • 1,444
  • 5
  • 27
  • 55
1
2 3
9 10