Changeset 97726 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 2, 2022 1:01:48 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/post.c
r96407 r97726 31 31 #include "inlines.h" 32 32 33 #if DEBUG_POST 33 #if DEBUG_POST || 0 34 34 # define DPRINT(...) BX_DEBUG(__VA_ARGS__) 35 35 #else … … 81 81 82 82 /* The ROM init routine might trash register. Give the compiler a heads-up. */ 83 typedef void (rom_init_rtn)(void); 84 #pragma aux rom_init_rtn modify [ax bx cx dx si di es] loadds; 83 typedef void __far (rom_init_rtn)(void); 84 #pragma aux rom_init_rtn modify [ax bx cx dx si di es /*ignored:*/ bp] /*ignored:*/ loadds; 85 86 /* The loadds bit is ignored for rom_init_rtn, the impression from the code 87 generator is that this is due to using a memory model where DS is fixed. 88 If we add DS as a modified register, we'll get run into compiler error 89 E1122 (BAD_REG) because FixedRegs() in cg/intel/386/c/386rgtbl.c returns 90 HW_DS as part of the fixed register set that cannot be modified. 91 92 The problem of the vga bios trashing DS isn't a biggie, except when 93 something goes sideways before we can reload it. Setting a I/O port 94 breakpoint on port 80h and wait a while before resuming execution 95 (ba i 1 80 "sleep 400 ; g") will usually trigger a keyboard init panic and 96 showcase the issue. The panic message is garbage because it's read from 97 segment 0c000h instead of 0f000h. */ 98 static void restore_ds_as_dgroup(void); 99 #pragma aux restore_ds_as_dgroup = \ 100 "mov ax, 0f000h" \ 101 "mov ds, ax" \ 102 modify exact [ax]; 103 85 104 86 105 /* Scan for ROMs in the given range and execute their POST code. */ … … 98 117 DPRINT("Found ROM at segment %04X\n", start_seg); 99 118 if (!rom_checksum((void __far *)rom, rom->num_blks)) { 100 rom_init_rtn __far*rom_init;119 rom_init_rtn *rom_init; 101 120 102 121 /* Checksum good, initialize ROM. */ 103 rom_init = ( void __far*)&rom->code;122 rom_init = (rom_init_rtn *)&rom->code; 104 123 rom_init(); 105 124 int_disable(); 125 restore_ds_as_dgroup(); 126 /** @todo BP is not restored. */ 106 127 DPRINT("ROM initialized\n"); 107 128
Note:
See TracChangeset
for help on using the changeset viewer.