mirror of
https://github.com/Alvin-Zilverstand/bob16.git
synced 2026-12-01 06:21:19 +01:00
Improve shell completion and Bob64 text readability
This commit is contained in:
1 parent
57787bfc7f
commit
412000b481
14 files changed
+2383
-1249
No files matched your search
@@ -28,6 +28,17 @@ handoff has been booted under QEMU with x64 OVMF firmware; the kernel reaches it
|
||||
shell after switching to its own page tables, and the GOP framebuffer has been
|
||||
visually checked at 1280x800.
|
||||
|
||||
The kernel console and GUI text helper share `bob64/font.h`'s bitmap-glyph
|
||||
renderer. The shell uses a clear 8x16 printable-ASCII font from
|
||||
`bob64/font8x16.h` on 9x18 cells (`FONT_WIDTH`, `FONT_HEIGHT`, `LINE_HEIGHT`,
|
||||
and `CHAR_SPACING`); lowercase and command punctuation have their own glyphs.
|
||||
The compact 5x7 font remains available for existing small GUI labels. Run
|
||||
`fonttest` in the shell to clear the display and show the alphabet, digits,
|
||||
commonly confused characters, punctuation, and a pangram. Host checks cover
|
||||
every printable glyph, cell wrapping, backspace, cursor position and scrolling;
|
||||
the QEMU/OVMF regression checks the full font sample on the live GOP display.
|
||||
The 8x16 bitmap's MIT license is included in `bob64/FONT_LICENSE.md`.
|
||||
|
||||
Kernel entry also adopts the seeded physical-page allocator and maps pages into
|
||||
a small coalescing heap in the high canonical address range. Its boot smoke test
|
||||
checks aligned allocation, zeroing, multi-page growth, writes, and freeing. The
|
||||
|
||||
+3
-2
@@ -123,7 +123,7 @@ static void erase_previous_character(void) {
|
||||
int bob64_framebuffer_init(u64 base,u64 size,u32 width,u32 height,
|
||||
u32 pixels_per_scan_line,u32 pixel_format) {
|
||||
u64 pixels,required;
|
||||
if(!base||!size||width<FONT_CELL_WIDTH||height<FONT_HEIGHT||
|
||||
if(!base||!size||!width||!height||
|
||||
pixels_per_scan_line<width||
|
||||
(pixel_format!=0&&pixel_format!=1)||
|
||||
(u64)pixels_per_scan_line>~(u64)0/height)return -1;
|
||||
@@ -136,6 +136,7 @@ int bob64_framebuffer_init(u64 base,u64 size,u32 width,u32 height,
|
||||
framebuffer.Width=width;framebuffer.Height=height;
|
||||
framebuffer.Stride=pixels_per_scan_line;framebuffer.Format=pixel_format;
|
||||
framebuffer.Column=0;framebuffer.Row=0;framebuffer.Ready=1;
|
||||
framebuffer.CursorDrawn=0;
|
||||
for(u32 y=0;y<height;y++)clear_row(y);
|
||||
return 0;
|
||||
}
|
||||
@@ -153,9 +154,9 @@ int bob64_framebuffer_resolution(u32 *width,u32 *height) {
|
||||
int bob64_framebuffer_write_pixels(u64 first_pixel,const u32 *pixels,u32 count) {
|
||||
u64 total;
|
||||
if(!framebuffer.Ready||(!pixels&&count))return -1;
|
||||
if(count&&framebuffer.CursorDrawn)erase_cursor();
|
||||
total=(u64)framebuffer.Width*framebuffer.Height;
|
||||
if(first_pixel>total||(u64)count>total-first_pixel)return -1;
|
||||
if(count&&framebuffer.CursorDrawn)erase_cursor();
|
||||
for(u32 i=0;i<count;i++) {
|
||||
u64 index=first_pixel+i;
|
||||
u32 red=(pixels[i]>>16)&0xff,green=(pixels[i]>>8)&0xff,blue=pixels[i]&0xff;
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ typedef struct {
|
||||
u8 BytesPerGlyph,ColumnMajor,MostSignificantBitFirst;
|
||||
} BOB64_BITMAP_FONT;
|
||||
|
||||
static const BOB64_BITMAP_FONT bob64_font5x7={
|
||||
static const BOB64_BITMAP_FONT bob64_font_compact5x7={
|
||||
&bob64_font5x7[0][0],5,7,44,5,1,0
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ static inline void bob64_gfx_text(BOB64_GFX *graphics,s32 x,s32 y,
|
||||
if(!graphics||!text||!scale)return;
|
||||
while(*text) {
|
||||
u32 glyph=bob64_gfx_glyph((u8)*text++);
|
||||
bob64_font_draw_glyph(&bob64_font5x7,glyph,cursor_x,origin_y,scale,
|
||||
bob64_font_draw_glyph(&bob64_font_compact5x7,glyph,cursor_x,origin_y,scale,
|
||||
bob64_gfx_font_plot_pixel,&context,color);
|
||||
cursor_x+=(s64)6*scale;
|
||||
}
|
||||
|
||||
@@ -90,6 +90,7 @@ static void show_font_test(BOB64_SHELL *shell) {
|
||||
output(shell,"[] {} () <> / \\ | _ - + = : ; , . ! ?\r\n");
|
||||
output(shell,"bob64 kernel shell\r\n");
|
||||
output(shell,"The quick brown fox jumps over the lazy dog.\r\n");
|
||||
output(shell,"bob!\r\n");
|
||||
}
|
||||
|
||||
static void compile_file_command(BOB64_SHELL *shell,char *arguments) {
|
||||
|
||||
Reference in new issue
Block a user