mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Show "screen of death" on VGA console upon program crash (#650)
* [metal] Refactoring: separate out sys_writev_vga() and _vga_init() modules * [metal] Read VGA info from BDA before long mode entry, not after If using a pre-existing VGA text console, the VGA initialization code now retrieves the cursor position & character height from the BIOS data area while still in real mode — rather than reading from the BIOS data area only after entering long mode. (This should help make the code more correct, if Cosmopolitan were to support UEFI graphics output in the future. If the program were booted via UEFI, then the long mode IsMetal() code would still be activated, but the BIOS data area might not have been initialized in that case.) This change also means that there are now a few more fields in the `struct mman`. * [metal] VGA console can now show "screen of death" upon a crash There is now a new function _klog_vga(), which can be called by kprintf() to output system messages — e.g. information about CPU exceptions — on the VGA screen. * [metal] CPU exception handler now dumps cr2 value * [metal] Add demo of program crash reporting w/ bare metal VGA TTY * [metal] Reduce size of "screen of death" code
This commit is contained in:
parent
7822917fc2
commit
d3efa47f81
13 changed files with 695 additions and 338 deletions
|
@ -29,6 +29,12 @@ struct mman {
|
|||
uint64_t pc_video_framebuffer; /* 0x1d30 — physical address of
|
||||
video frame buffer */
|
||||
uint64_t pc_video_framebuffer_size; /* 0x1d38 */
|
||||
struct { /* 0x1d40 — starting cursor pos. */
|
||||
unsigned short y, x;
|
||||
} pc_video_curs_info;
|
||||
unsigned short pc_video_char_height; /* 0x1d44 — character height (useful
|
||||
for setting cursor shape
|
||||
in text mode) */
|
||||
};
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue