mirror of
https://github.com/Tom-on64/kern.git
synced 2026-11-04 10:33:12 +00:00
Started working on disk.h header
This commit is contained in:
+3
-1
@@ -88,7 +88,7 @@ puts:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
;; Data
|
;; Data
|
||||||
driveNum: db 3
|
driveNum: db 0
|
||||||
counter: db 0
|
counter: db 0
|
||||||
cursor: dw 0
|
cursor: dw 0
|
||||||
|
|
||||||
@@ -112,6 +112,8 @@ protected_start:
|
|||||||
mov esp, ebp
|
mov esp, ebp
|
||||||
|
|
||||||
; Perform the far jump
|
; Perform the far jump
|
||||||
|
mov al, [driveNum]
|
||||||
|
push ax
|
||||||
jmp KERNEL_LOC
|
jmp KERNEL_LOC
|
||||||
|
|
||||||
;; GDT
|
;; 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'
|
;; Calls the main function in 'main.c'
|
||||||
_start:
|
_start:
|
||||||
|
pop ax
|
||||||
|
mov [driveNum], al
|
||||||
call main
|
call main
|
||||||
jmp $ ;; If we used cli, hlt we wouldn't have interrupts :/
|
jmp $ ;; If we used cli, hlt we wouldn't have interrupts :/
|
||||||
|
|
||||||
|
[global driveNum]
|
||||||
|
driveNum: db 0
|
||||||
|
|
||||||
;;
|
;;
|
||||||
;; --- IDT ---
|
;; --- IDT ---
|
||||||
;;
|
;;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "system.h"
|
#include "system.h"
|
||||||
|
#include "disk.h"
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
// Interrupts
|
// Interrupts
|
||||||
@@ -20,5 +22,8 @@ void main() {
|
|||||||
|
|
||||||
clear(0x0f);
|
clear(0x0f);
|
||||||
print("kern.\n\n", 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