summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
authorMiguel <m.i@gmx.at>2018-09-09 13:21:47 +0200
committerMiguel <m.i@gmx.at>2018-09-09 13:21:47 +0200
commitc2ef64149849fcae608b1c6010303eca86229d22 (patch)
tree30d69313b6975a7c1bfc80859117124a6a5a10e7 /asm
parente85a68e1536a0f6505300e1cb79f06b9743b00f7 (diff)
cleaning logs, docs, interrupts
Diffstat (limited to 'asm')
-rw-r--r--asm/asm_gdt.h9
-rw-r--r--asm/asm_gdt.s4
-rw-r--r--asm/asm_int.h8
-rw-r--r--asm/asm_mp.asm2
-rw-r--r--asm/asm_mp.h10
-rw-r--r--asm/asm_pic.h1
-rw-r--r--asm/asm_start.h9
-rw-r--r--asm/asm_usermode.h1
8 files changed, 38 insertions, 6 deletions
diff --git a/asm/asm_gdt.h b/asm/asm_gdt.h
index 128dbf3..c2c35a0 100644
--- a/asm/asm_gdt.h
+++ b/asm/asm_gdt.h
@@ -3,5 +3,12 @@
* http://wiki.osdev.org/GDT_Tutorial
*/
-/** call as asm_setup_gdt(GDT,sizeof(GDT)) */
+/**
+ * Set the Global Descritpor Table from data at _addr_.
+ *
+ * call as asm_setup_gdt(GDT,sizeof(GDT))
+ *
+ * This will jump to 0x8 segment and set 0x10 data selector
+ * also refereshing the tss entry.
+ * */
void asm_setup_gdt(uint32_t addr, uint32_t size);
diff --git a/asm/asm_gdt.s b/asm/asm_gdt.s
index 0e163fc..a35854d 100644
--- a/asm/asm_gdt.s
+++ b/asm/asm_gdt.s
@@ -1,5 +1,9 @@
.global asm_setup_gdt
+gdt_descriptor:
+.int 0
+.int 0
+
asm_setup_gdt:
// re-fill gdt_descriptor with new GDT location and size
diff --git a/asm/asm_int.h b/asm/asm_int.h
index 465b08b..5f32777 100644
--- a/asm/asm_int.h
+++ b/asm/asm_int.h
@@ -1,3 +1,11 @@
+/**
+ * @file
+ *
+ * interrrupt handlers:
+ * * excX() call handle_exception
+ * * excX() call hadnle_interrupt
+ */
+
void int0();
void int1();
void int2();
diff --git a/asm/asm_mp.asm b/asm/asm_mp.asm
index 165dc97..18b9d7e 100644
--- a/asm/asm_mp.asm
+++ b/asm/asm_mp.asm
@@ -1,9 +1,7 @@
global smp_start
extern smp_main
-global gdt_descriptor
global asm_smp_unlock
-
; master boot record for application processors
smp_start:
[bits 16]
diff --git a/asm/asm_mp.h b/asm/asm_mp.h
index f207c12..f36f4f7 100644
--- a/asm/asm_mp.h
+++ b/asm/asm_mp.h
@@ -1,3 +1,11 @@
-/** Application processors */
+/**
+ * @file
+ * Multiprocessing
+ * ===============
+ *
+ * smp_start should be entered by the application processors and calls
+ * the C-function: smp_main() in turn.
+ * */
+
void smp_start();
void asm_smp_unlock();
diff --git a/asm/asm_pic.h b/asm/asm_pic.h
index 0daea2a..7f25515 100644
--- a/asm/asm_pic.h
+++ b/asm/asm_pic.h
@@ -1 +1,2 @@
+/** remap the pic and disable it */
void asm_pic_setup();
diff --git a/asm/asm_start.h b/asm/asm_start.h
index 4b2db16..3315d50 100644
--- a/asm/asm_start.h
+++ b/asm/asm_start.h
@@ -1,13 +1,18 @@
/**
* @file
+ *
+ * START
+ * =====
+ *
* Defines the following sections/functions, some are linked at
* specific addresses in the final ELF kernel binary.
* This is specified in the _linker.ld_ file.
*
- * TODO: THIS IS NOT TRUE ANYMORE (SINCE IT KILLED THE MEMORY IN BETWEEN PROABBLY)
- * * 0x007000 .smp - entry point for application processors (16bit code)
+ * * 0x007000 .smp - entry point for application processors (16bit code) _start_smp() calls finally smp_main()
* * 0x100000 .multiboot - the multiboot header
*
+ * __TODO: Does this not kill the memory in-between?__
+ *
* * .text
* * .bootstrap_stack
* * _start() - main entry point for booting cpu, calls kernel_main().
diff --git a/asm/asm_usermode.h b/asm/asm_usermode.h
index 16597f2..295a64d 100644
--- a/asm/asm_usermode.h
+++ b/asm/asm_usermode.h
@@ -1,5 +1,6 @@
/**
* @file
+ *
* Switch to User Mode and iret to function given by pointer
* provide the address of a void func() that will be called without
* any params via iret.