0

I am trying so hard to figure out what this does

.set ALIGN,    1<<0             # align loaded modules on page boundaries
.set MEMINFO,  1<<1             # provide memory map
.set FLAGS,    ALIGN | MEMINFO  # this is the Multiboot 'flag' field
.set MAGIC,    0x1BADB002       # 'magic number' lets bootloader find the header
.set CHECKSUM, -(MAGIC + FLAGS) # checksum of above, to prove we are multiboot

So i have all these comment lines but I can't find why is this. How the first set align loaded modules couse the result for ALIGN global variable is 1 and MEMINFO is 2. I can't find out.

Nikola Jokic
  • 103
  • 9

1 Answers1

0

Michael's link to the Multiboot Specification shows exactly what's going on. The FLAGS symbol, which contains 0xB0000000 in your case, specifies features that the OS image requests or requires of a boot loader. Bit 0, which is set thanks to the ALIGN symbol, specifies that all boot modules loaded along with the operating system must be aligned on page (4KB) boundaries. Bits 2, which is set thanks to the MEMINFO symbol, specifies that memory information is required.

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38