Started working on disk.h header

This commit is contained in:
2024-03-12 16:13:24 +01:00
parent ce9b2b95a2
commit d8ddd93832
5 changed files with 22 additions and 1 deletions
+3 -1
View File
@@ -88,7 +88,7 @@ puts:
ret
;; Data
driveNum: db 3
driveNum: db 0
counter: db 0
cursor: dw 0
@@ -112,6 +112,8 @@ protected_start:
mov esp, ebp
; Perform the far jump
mov al, [driveNum]
push ax
jmp KERNEL_LOC
;; GDT
+1
View File
@@ -0,0 +1 @@
#include "disk.h"
+8
View File
@@ -0,0 +1,8 @@
#ifndef DISK_H
#define DISK_H
#include "stdint.h"
extern uint8_t driveNum;
#endif
+5
View File
@@ -8,9 +8,14 @@
;; Calls the main function in 'main.c'
_start:
pop ax
mov [driveNum], al
call main
jmp $ ;; If we used cli, hlt we wouldn't have interrupts :/
[global driveNum]
driveNum: db 0
;;
;; --- IDT ---
;;
+5
View File
@@ -5,6 +5,8 @@
#include "keyboard.h"
#include "timer.h"
#include "system.h"
#include "disk.h"
#include "string.h"
void main() {
// Interrupts
@@ -20,5 +22,8 @@ void main() {
clear(0x0f);
print("kern.\n\n", 0x0f);
print("Drive: 0x", 0x0f);
print(itoa(driveNum, 16), 0x0f);
putc('\n', 0x00);
}