summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-06-16 19:36:10 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-06-16 19:36:10 +0200
commit0061eeb77f73a7832c4c72aba8dd56dc91743171 (patch)
tree4387e1ea40cd1e804cb077ddbabc7509cd26f530 /src
parentdd7cbebcb41381fdb87e5c8e4d9d988337919c9c (diff)
downloadabaos-0061eeb77f73a7832c4c72aba8dd56dc91743171.tar.gz
abaos-0061eeb77f73a7832c4c72aba8dd56dc91743171.tar.bz2
playing with VGA font distance and characters bei being on the head or mirrored
Diffstat (limited to 'src')
-rw-r--r--src/Makefile6
-rw-r--r--src/boot/stage2_real_functions.asm2
-rw-r--r--src/drivers/video/vga.c4
-rw-r--r--src/kernel/kernel.c12
4 files changed, 18 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile
index 68f3a0f..cb72031 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -11,16 +11,16 @@ all: image.bin kernel.sym
# truncate to correct number of sectors, we have
# 512 (boot, stage 1) + N * 512 (N currenty is 5, stage 2) for boot.bin
-# + M * 512 (M is currently 156) for kernel.bin
+# + M * 512 (M is currently 158) for kernel.bin
# (M + N + 1 is the number of sectors to be read in stage 2, as stage 1
# loads only the first sector, and stage 1 loads 5 sectors of stage 2,
-# adapt NOF_LOAD_SECTORS to 156)
+# adapt NOF_LOAD_SECTORS to 158)
# then we make sure the image has the size of a 1.44 MB floppy
# (emulators like qemu do some guess work for CHS resolution based
# on the size of the image)
image.bin: boot.bin kernel.bin magic.bin
cat boot.bin kernel.bin > image.tmp
- truncate -s 82432 image.tmp
+ truncate -s 83456 image.tmp
cat image.tmp magic.bin > image.bin
truncate -s 1474560 image.bin
diff --git a/src/boot/stage2_real_functions.asm b/src/boot/stage2_real_functions.asm
index 2c38107..e72b783 100644
--- a/src/boot/stage2_real_functions.asm
+++ b/src/boot/stage2_real_functions.asm
@@ -2,7 +2,7 @@
; (note: the first sector gets loaded by the BIOS, the
; next 5 sectors are read by the simple stage 1 loader,
; so subtract 6 here!)
-NOF_LOAD_SECTORS equ 156
+NOF_LOAD_SECTORS equ 158
; data sections used for reading the kernel from disk
SECTORS_PER_CYLINDER:
diff --git a/src/drivers/video/vga.c b/src/drivers/video/vga.c
index cf1157c..bb73f1e 100644
--- a/src/drivers/video/vga.c
+++ b/src/drivers/video/vga.c
@@ -312,9 +312,9 @@ void vga_draw_char( vga_t *vga, const unsigned char c, const int x, const int y,
for( int xx = 0; xx < vga_font.Width; xx++ ) {
for( int yy = 0; yy < vga_font.Height; yy++ ) {
if( bmap[yy] & mask[xx] ) {
- vga_set_pixel( vga, x + xx, y + yy, foreground );
+ vga_set_pixel( vga, x + 10 - xx, y + yy, foreground );
} else {
- vga_set_pixel( vga, x + xx, y + yy, background );
+ vga_set_pixel( vga, x + 10 - xx, y + yy, background );
}
}
}
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 6342a26..f36c2ff 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -195,6 +195,18 @@ static void handle_keyboard_event( keyboard_event_t *event, void *context )
vga_clear_screen( vga, vga_make_RGB( 0x00, 0x00, 0xA8 ) );
vga_draw_char( vga, 'A', 100, 100, vga_make_RGB( 0x00, 0x00, 0xA8 ),
vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
+ vga_draw_char( vga, 'B', 110, 100, vga_make_RGB( 0x00, 0x00, 0xA8 ),
+ vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
+ vga_draw_char( vga, 'C', 120, 100, vga_make_RGB( 0x00, 0x00, 0xA8 ),
+ vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
+ vga_draw_char( vga, 'D', 130, 100, vga_make_RGB( 0x00, 0x00, 0xA8 ),
+ vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
+ vga_draw_char( vga, 'E', 140, 100, vga_make_RGB( 0x00, 0x00, 0xA8 ),
+ vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
+ vga_draw_char( vga, 'F', 150, 100, vga_make_RGB( 0x00, 0x00, 0xA8 ),
+ vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
+ vga_draw_char( vga, 'G', 160, 100, vga_make_RGB( 0x00, 0x00, 0xA8 ),
+ vga_make_RGB( 0xFF, 0xFF, 0xFF ) );
}
global_context->mode = MODE_GRAPHICS;
break;