diff options
Diffstat (limited to 'rsnix/src/vt.rs')
| -rw-r--r-- | rsnix/src/vt.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/rsnix/src/vt.rs b/rsnix/src/vt.rs index 53821b7..4578f6c 100644 --- a/rsnix/src/vt.rs +++ b/rsnix/src/vt.rs | |||
| @@ -96,6 +96,26 @@ static mut CUR: usize = 0; | |||
| 96 | /// Allocate the cell grid. Call once after `gop::init()`. | 96 | /// Allocate the cell grid. Call once after `gop::init()`. |
| 97 | pub fn init() { | 97 | pub fn init() { |
| 98 | let (cols, rows) = gop::dims(); | 98 | let (cols, rows) = gop::dims(); |
| 99 | if rows == 0 || cols == 0 { | ||
| 100 | // No usable framebuffer geometry: GOP is missing entirely or the | ||
| 101 | // active mode reports 0x0. Without a display there is nothing | ||
| 102 | // the shell can do, so stop with a visible explanation instead | ||
| 103 | // of building an empty grid and panicking at the first cell | ||
| 104 | // write (a blank screen on real hardware, which has no serial | ||
| 105 | // console). | ||
| 106 | let lines = [ | ||
| 107 | "FATAL: no framebuffer geometry", | ||
| 108 | "GOP missing or active mode is 0x0", | ||
| 109 | "see the 'gop:' boot marker / serial log", | ||
| 110 | ]; | ||
| 111 | crate::gop::dump_lines(&lines); | ||
| 112 | crate::serial_println!("FATAL: no framebuffer geometry (GOP missing or 0x0 mode)"); | ||
| 113 | loop { | ||
| 114 | unsafe { | ||
| 115 | core::arch::asm!("cli; hlt"); | ||
| 116 | } | ||
| 117 | } | ||
| 118 | } | ||
| 99 | unsafe { | 119 | unsafe { |
| 100 | ROWS = rows; | 120 | ROWS = rows; |
| 101 | COLS = cols; | 121 | COLS = cols; |
