From c968aa28acc40414a988877a3d9922bd615058db Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Tue, 26 Aug 2003 22:00:00 -0400 Subject: [PATCH] Import backup from 2003-08-26 --- bootdef.inc | 2 +- io.h | 12 ++++++++++++ k_defines.h | 7 +++++++ kernel.c | 2 ++ mm.c | 12 ++++++++++++ mm.h | 17 +++++++++++++++++ 6 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 io.h create mode 100644 mm.c create mode 100644 mm.h diff --git a/bootdef.inc b/bootdef.inc index 55ab767..94ed1e2 100644 --- a/bootdef.inc +++ b/bootdef.inc @@ -17,7 +17,7 @@ %define BOOT_VESA_VBE 0x0106 ;512 - copy of VESA VBEInfoBlock %define BOOT_VESA_INFO 0x0306 ;256 - copy of VESA ModeInfoBlock for selected mode %define BOOT_MEMENTRIES 0x040A ;4 - dword = number of memmap entries -%define BOOT_MEMMAP 0x040E ;? - memory map information +%define BOOT_MEMMAP 0x2000 ;? - memory map information diff --git a/io.h b/io.h new file mode 100644 index 0000000..0b747bd --- /dev/null +++ b/io.h @@ -0,0 +1,12 @@ + + +#ifndef __HIO_H__ +#define __HIO_H__ __HIO_H__ + +void writeCursorPosition(dword pos); +dword getCursorPosition(); +void putc(byte chr); +int printf(char *fmt, ...); + +#endif + diff --git a/k_defines.h b/k_defines.h index 432b407..ec6e61f 100644 --- a/k_defines.h +++ b/k_defines.h @@ -36,5 +36,12 @@ typedef unsigned char byte; typedef unsigned short word; typedef unsigned int dword; +typedef struct { + dword lowdword; + dword highdword; +} __attribute__((packed)) qword; + + + diff --git a/kernel.c b/kernel.c index 782fca4..fb0b7c5 100644 --- a/kernel.c +++ b/kernel.c @@ -5,10 +5,12 @@ #include "k_defines.h" #include "functions.h" #include "video.h" +#include "mm.h" void isr(dword num); void k_init(); +#include "mm.c" #include "functions.c" #include "video.c" diff --git a/mm.c b/mm.c new file mode 100644 index 0000000..a6ae7af --- /dev/null +++ b/mm.c @@ -0,0 +1,12 @@ + + +void mm_init() +{ + dword *memmap_entries = 0x9040A; + memmap_entry *maps = 0x92000; + + + +} + + diff --git a/mm.h b/mm.h new file mode 100644 index 0000000..33132ef --- /dev/null +++ b/mm.h @@ -0,0 +1,17 @@ + + +void mm_init(); + + + +typedef struct { + qword base; + qword length; + dword attributes; +} __attribute__((packed)) memmap_entry; + + + + + +