diff options
| author | Michal Idziorek <m.i@gmx.at> | 2014-07-08 17:15:01 +0200 |
|---|---|---|
| committer | Michal Idziorek <m.i@gmx.at> | 2014-07-08 17:15:01 +0200 |
| commit | bf67de78c26c6f6e585f11899591f61da5a2c3d8 (patch) | |
| tree | 6c5b51d3746aad55d2aef5c15f3771518244dc37 | |
| parent | 900781f1985bb814aa7992022aead985fc967611 (diff) | |
added some comments and cleaned up the .asm files
| -rw-r--r-- | boot/GDT.asm | 16 | ||||
| -rw-r--r-- | boot/common.asm | 9 | ||||
| -rw-r--r-- | boot/common_pm.asm | 10 | ||||
| -rw-r--r-- | boot/fill.asm | 9 | ||||
| -rw-r--r-- | boot/kernel_entry.asm | 15 | ||||
| -rw-r--r-- | boot/mbr.asm | 2 | ||||
| -rw-r--r-- | boot/old.asm | 56 | ||||
| -rw-r--r-- | boot/pm.asm | 8 |
8 files changed, 62 insertions, 63 deletions
diff --git a/boot/GDT.asm b/boot/GDT.asm index 27514de..df76210 100644 --- a/boot/GDT.asm +++ b/boot/GDT.asm @@ -1,3 +1,19 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; Global Descriptor Table +; we have the null descriptor and a code and data block for a start +; +; 0x80 code segment +; 0x10 data segment +; +; this file contains pure data +; +; +; +; + gdt_start: gdt_null: ;null descriptor (2 x 4 bytes) diff --git a/boot/common.asm b/boot/common.asm index 02e1a0b..c241f55 100644 --- a/boot/common.asm +++ b/boot/common.asm @@ -1,6 +1,15 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +;print_string +;print_hex +;disk_load +; +; +; +; + [bits 16] diff --git a/boot/common_pm.asm b/boot/common_pm.asm index 40bc32f..c96e1a8 100644 --- a/boot/common_pm.asm +++ b/boot/common_pm.asm @@ -1,3 +1,13 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +;print_string_pm +;print_hex_pm +; +; +; + [bits 32] VIDEO_MEM equ 0xb8000 diff --git a/boot/fill.asm b/boot/fill.asm index 1717006..0d40c24 100644 --- a/boot/fill.asm +++ b/boot/fill.asm @@ -1 +1,10 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; +; just some data to fill empty space to get a full image +; +; + times 2000000 db 0xff diff --git a/boot/kernel_entry.asm b/boot/kernel_entry.asm index 77bb2a5..f1e3b6b 100644 --- a/boot/kernel_entry.asm +++ b/boot/kernel_entry.asm @@ -1,10 +1,11 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; this will be compiled to an object file and linked with the kernel +; to simplify the entrance! +; +; [bits 32] - [extern kernel_main] -[extern int0] - call kernel_main ; jumps in the world of C -call int0 ; jumps in the world of C -ret - -jmp $ diff --git a/boot/mbr.asm b/boot/mbr.asm index 1e7c53d..a04b759 100644 --- a/boot/mbr.asm +++ b/boot/mbr.asm @@ -5,6 +5,8 @@ ; Copyright 2014 M.Idziorek <m.i@gmx.at> ; ; we have just been loaded by the BIOS and are in 16-bits real mode! +; THIS IS THE CENTRAL FILE OF THE BOOTLOADER, after we finished we +; are inside the C kernel! ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/boot/old.asm b/boot/old.asm deleted file mode 100644 index a7a1b24..0000000 --- a/boot/old.asm +++ /dev/null @@ -1,56 +0,0 @@ - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;read data from disk -;mov bx,0x9000 ;destination(es:bx) -;mov dh,1 ;number of sectors -;mov dl,[BOOT_DRIVE] ;source disk -;call disk_load - -;print data loaded form disk -;mov dx,[0x9000] -;call print_hex - -;mov dx,[0x9000+256] -;call print_hex - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -;;;;; COM1 infinite loop ;;;;; -; -; COM1_PORT equ 0xD000 -; mov dx,COM1_PORT -; mov ecx,160*2 -; -; ; loop and write all data other than 0x0 -; com1_loop: -; -; in ax,dx ; read port val -; -; cmp ax,0xffff -; je com1_skip -; -; cmp ax,0x0 -; je com1_skip -; -; call print_hex_pm -; add ecx,14 -; pusha -; mov dx,ax -; call print_hex_pm -; popa -; add ecx,26 -; -; com1_skip: -; -; inc dx -; ;call print_hex_pm -; cmp dx,COM1_PORT+0x300 -; jne com1_loop -; mov dx,COM1_PORT -; mov ecx,160*2 -; jmp com1_loop -; - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - diff --git a/boot/pm.asm b/boot/pm.asm index c66ab4f..8a4f745 100644 --- a/boot/pm.asm +++ b/boot/pm.asm @@ -1,3 +1,11 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;; Miguel's FoolOS Helper Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; +; switch_to_pm - actual switch from 16bit real to 32bit protected +; init_pm - sets up some regs and calls boot_32_pm +; + [bits 16] switch_to_pm: |
