Changeset 84752 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 10, 2020 10:58:33 AM (5 years ago)
- Location:
- trunk/src/VBox/Devices/PC
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/BIOS/apm.c
r82968 r84752 129 129 */ 130 130 131 /* Output a null-terminated string to a specified port, without the132 * terminating null character.133 */134 static void apm_out_str_asm(uint16_t port, const char *s);135 #pragma aux apm_out_str_asm = \136 "mov al, [bx]" \137 "next:" \138 "out dx, al" \139 "inc bx" \140 "mov al, [bx]" \141 "or al, al" \142 "jnz next" \143 parm [dx] [bx] modify exact [ax bx] nomemory;144 145 131 /* Wrapper to avoid unnecessary inlining. */ 146 void apm_out_str(const char *s , uint16_t port)132 void apm_out_str(const char *s) 147 133 { 148 134 if (*s) 149 apm_out_str_asm(port, s);135 out_ctrl_str_asm(VBOX_BIOS_SHUTDOWN_PORT, s); 150 136 } 151 137 … … 200 186 switch (CX) { 201 187 case APM_PS_STANDBY: 202 apm_out_str("Standby" , VBOX_BIOS_SHUTDOWN_PORT);188 apm_out_str("Standby"); 203 189 break; 204 190 case APM_PS_SUSPEND: 205 apm_out_str("Suspend" , VBOX_BIOS_SHUTDOWN_PORT);191 apm_out_str("Suspend"); 206 192 break; 207 193 case APM_PS_OFF: 208 apm_out_str("Shutdown" , VBOX_BIOS_SHUTDOWN_PORT);/* Should not return. */194 apm_out_str("Shutdown"); /* Should not return. */ 209 195 break; 210 196 default: -
trunk/src/VBox/Devices/PC/BIOS/bios.c
r82968 r84752 57 57 #include "inlines.h" 58 58 #include "biosint.h" 59 #include "VBox/bios.h" 59 60 #ifndef VBOX_VERSION_STRING 60 61 #include <VBox/version.h> … … 121 122 void BIOSCALL int18_panic_msg(void) 122 123 { 123 BX_PANIC("INT18: BOOT FAILURE\n"); 124 BX_INFO("INT18: BOOT FAILURE\n"); 125 out_ctrl_str_asm(VBOX_BIOS_SHUTDOWN_PORT, "Bootfail"); 124 126 } 125 127 -
trunk/src/VBox/Devices/PC/BIOS/biosint.h
r82968 r84752 286 286 #ifdef VBOX 287 287 #define BX_INFO(...) do { put_str(BIOS_PRINTF_INFO, bios_prefix_string); bios_printf(BIOS_PRINTF_INFO, __VA_ARGS__); } while (0) 288 #define BX_INFO_CON(...)do { put_str(BIOS_PRINTF_INFO, bios_prefix_string); bios_printf(BIOS_PRINTF_ALL, __VA_ARGS__); } while (0) 288 289 #else /* !VBOX */ 289 290 #define BX_INFO(...) bios_printf(BIOS_PRINTF_INFO, __VA_ARGS__) -
trunk/src/VBox/Devices/PC/BIOS/boot.c
r82968 r84752 151 151 if (lastdrive==1) { 152 152 if (reason==0) 153 BX_ PANIC("No bootable medium found! System halted.\n");153 BX_INFO_CON("No bootable medium found! Please insert a bootable medium and reboot.\n"); 154 154 else 155 155 BX_PANIC("Could not read from the boot medium! System halted.\n"); -
trunk/src/VBox/Devices/PC/BIOS/inlines.h
r82968 r84752 99 99 "jmp forever" \ 100 100 modify exact [] nomemory aborts; 101 102 /* Output a null-terminated string to a specified port, without the 103 * terminating null character. 104 */ 105 static void out_ctrl_str_asm(uint16_t port, const char *s); 106 #pragma aux out_ctrl_str_asm = \ 107 "mov al, [bx]" \ 108 "next:" \ 109 "out dx, al" \ 110 "inc bx" \ 111 "mov al, [bx]" \ 112 "or al, al" \ 113 "jnz next" \ 114 parm [dx] [bx] modify exact [ax bx] nomemory; 101 115 102 116 #ifdef __386__ -
trunk/src/VBox/Devices/PC/BIOS/orgs.asm
r84673 r84752 1580 1580 call _int18_panic_msg 1581 1581 ;; TODO: handle failure better? 1582 sti 1583 stay_here: 1582 1584 hlt 1583 iret1585 jmp stay_here 1584 1586 1585 1587 ;; -
trunk/src/VBox/Devices/PC/DevPcBios.cpp
r83032 r84752 155 155 /** Boot devices (ordered). */ 156 156 DEVPCBIOSBOOT aenmBootDevice[4]; 157 /** Bochs shutdownindex. */158 uint32_t i Shutdown;157 /** Bochs control string index. */ 158 uint32_t iControl; 159 159 /** Floppy device. */ 160 160 char *pszFDDevice; … … 338 338 { 339 339 static const unsigned char s_szShutdown[] = "Shutdown"; 340 if ( pThis->iShutdown < sizeof(s_szShutdown) /* paranoia */ 341 && u32 == s_szShutdown[pThis->iShutdown]) 342 { 343 pThis->iShutdown++; 344 if (pThis->iShutdown >= 8) 340 static const unsigned char s_szBootfail[] = "Bootfail"; 341 AssertCompile(sizeof(s_szShutdown) == sizeof(s_szBootfail)); 342 343 if (pThis->iControl < sizeof(s_szShutdown)) /* paranoia */ 344 { 345 if (u32 == s_szShutdown[pThis->iControl]) 345 346 { 346 pThis->iShutdown = 0; 347 LogRel(("PcBios: APM shutdown request\n")); 348 return PDMDevHlpVMPowerOff(pDevIns); 347 348 pThis->iControl++; 349 if (pThis->iControl >= 8) 350 { 351 pThis->iControl = 0; 352 LogRel(("PcBios: APM shutdown request\n")); 353 return PDMDevHlpVMPowerOff(pDevIns); 354 } 349 355 } 356 else if (u32 == s_szBootfail[pThis->iControl]) 357 { 358 pThis->iControl++; 359 if (pThis->iControl >= 8) 360 { 361 pThis->iControl = 0; 362 LogRel(("PcBios: Boot failure\n")); 363 } 364 } 365 else 366 pThis->iControl = 0; 350 367 } 351 368 else 352 pThis->i Shutdown= 0;369 pThis->iControl = 0; 353 370 } 354 371 /* else: not in use. */
Note:
See TracChangeset
for help on using the changeset viewer.