forked from PoliEcho-holding-org/kern
Started working on disk.h header
This commit is contained in:
+3
-1
@@ -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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
#include "disk.h"
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef DISK_H
|
||||
#define DISK_H
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
extern uint8_t driveNum;
|
||||
|
||||
#endif
|
||||
@@ -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,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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user