removed jank functions and got a cursor to blink properly
This commit is contained in:
parent
74d88173b1
commit
86f2db05a0
@ -19,21 +19,17 @@ void write_cell_fb(unsigned cell, char c, char fg, char bg) {
|
|||||||
Frame_Buffer[cell+1] = (fg & 0x0f << 4) | (bg & 0x0f);
|
Frame_Buffer[cell+1] = (fg & 0x0f << 4) | (bg & 0x0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* should be passing in a cell-position for position param*/
|
|
||||||
void print_fb(char* str, unsigned position) {
|
|
||||||
unsigned relative_end = position + strlen(str);
|
|
||||||
for(unsigned i = position; i<relative_end; i++) {
|
|
||||||
write_cell_fb(FRAME_CELL(i), str[i], Green, White);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear_fb() {
|
void clear_fb() {
|
||||||
for(unsigned cell=0;cell<AREA; cell+=2) {
|
for(unsigned cell=0;cell<AREA; cell+=2) {
|
||||||
write_cell_fb(cell, ' ', 0x00, 0x00);
|
write_cell_fb(cell, ' ', 0x00, 0x00);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generic test func for this module */
|
/* generic test func for this module */
|
||||||
void test_fb() {
|
void test_fb() {
|
||||||
clear_fb();
|
clear_fb();
|
||||||
print_fb("adsf", POSITION(0,5));
|
write_cell_fb(FRAME_CELL(0), 'a', Green, White);
|
||||||
|
write_cell_fb(FRAME_CELL(1), 'b', Green, White);
|
||||||
|
write_cell_fb(FRAME_CELL(2), 'c', Green, White);
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#define COLUMNS 80
|
#define COLUMNS 80
|
||||||
#define ROWS 25
|
#define ROWS 25
|
||||||
#define AREA ( COLUMNS * ROWS )
|
#define AREA ( COLUMNS * ROWS )
|
||||||
#define POSITION(ROW, COL) ( (ROW * COLUMNS) + COL )
|
|
||||||
|
|
||||||
// address of our frame buffer
|
// address of our frame buffer
|
||||||
#define FRAME_BUFFER_ADDR 0x000B8000
|
#define FRAME_BUFFER_ADDR 0x000B8000
|
||||||
|
23
loader.asm
23
loader.asm
@ -20,15 +20,24 @@ align 4
|
|||||||
dd CHECKSUM
|
dd CHECKSUM
|
||||||
|
|
||||||
loader:
|
loader:
|
||||||
|
mov al, 14
|
||||||
|
mov dx, 0x3d4
|
||||||
|
out dx, al ; 14 tells the framebuffer to expect the highest 8 bits of the position
|
||||||
|
|
||||||
|
mov al, 0
|
||||||
|
mov dx, 0x3d5
|
||||||
|
out dx, al ; sending the highest 8 bits of 0x0050
|
||||||
|
|
||||||
|
mov al, 15
|
||||||
|
mov dx, 0x3d4
|
||||||
|
out dx, al ; 15 tells the framebuffer to expect the lowest 8 bits of the position
|
||||||
|
|
||||||
|
mov al, 0
|
||||||
|
mov dx, 0x3d5
|
||||||
|
out dx, al ; sending the lowest 8 bits of 0x0050
|
||||||
|
|
||||||
call test_fb
|
call test_fb
|
||||||
|
|
||||||
.loop:
|
.loop:
|
||||||
jmp .loop
|
jmp .loop
|
||||||
|
|
||||||
section .bss
|
|
||||||
align 4 ; aligned to 4 bytes for performance
|
|
||||||
kernel_stack:
|
|
||||||
; (res)erve (b)ytes x
|
|
||||||
resb KERNEL_STACK_SIZE ; 4k of stack size in mem
|
|
||||||
; now we setup the stack pointer for our kernel
|
|
||||||
mov esp, kernel_stack + KERNEL_STACK_SIZE
|
|
||||||
|
Loading…
Reference in New Issue
Block a user