Skip to content

Commit 4d03c8b

Browse files
mosmehcopy
authored andcommitted
Add missing MULTIBOOT_INFO_MODS flag
1 parent ee1e42c commit 4d03c8b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/cpu.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,7 @@ CPU.prototype.load_multiboot_option_rom = function(buffer, initrd, cmdline)
13021302
const MULTIBOOT_SEARCH_BYTES = 8192;
13031303
const MULTIBOOT_INFO_STRUCT_LEN = 116;
13041304
const MULTIBOOT_INFO_CMDLINE = 0x4;
1305+
const MULTIBOOT_INFO_MODS = 0x8;
13051306
const MULTIBOOT_INFO_MEM_MAP = 0x40;
13061307

13071308
if(buffer.byteLength < MULTIBOOT_SEARCH_BYTES)
@@ -1397,8 +1398,6 @@ CPU.prototype.load_multiboot_option_rom = function(buffer, initrd, cmdline)
13971398
cpu.write32(multiboot_info_addr + 44, multiboot_mmap_count);
13981399
}
13991400

1400-
cpu.write32(multiboot_info_addr, info);
1401-
14021401
let entrypoint = 0;
14031402
let top_of_load = 0;
14041403

@@ -1508,6 +1507,8 @@ CPU.prototype.load_multiboot_option_rom = function(buffer, initrd, cmdline)
15081507

15091508
if(initrd)
15101509
{
1510+
info |= MULTIBOOT_INFO_MODS;
1511+
15111512
cpu.write32(multiboot_info_addr + 20, 1); // mods_count
15121513
cpu.write32(multiboot_info_addr + 24, multiboot_data); // mods_addr;
15131514

@@ -1530,6 +1531,8 @@ CPU.prototype.load_multiboot_option_rom = function(buffer, initrd, cmdline)
15301531
cpu.write_blob(new Uint8Array(initrd), ramdisk_address);
15311532
}
15321533

1534+
cpu.write32(multiboot_info_addr, info);
1535+
15331536
// set state for multiboot
15341537

15351538
cpu.reg32[REG_EBX] = multiboot_info_addr;

0 commit comments

Comments
 (0)