idk what i added

This commit is contained in:
2025-12-30 22:52:30 +00:00
parent 0222a7adb9
commit e0809f84dc
10 changed files with 491 additions and 112 deletions

View File

@@ -1,17 +1,17 @@
ORG 00h
BITS 16
root_buffer equ 24000h
data_buffer equ 26000h
root_buffer: equ 24000h ; Stores a dump of the root directory
metadata_buffer: equ 27000h ; Stores metadata about whatever's in the data buffer
output_buffer: equ 27020h ; Buffer storing stuff you'll output
file_buffer: equ 28000h ; Stores actual data to be read
start:
call disk_load_root ; Loads the root directory into disk_buffer for future use
mov si, boot_message
call os_print_string
call disk_load_root ; Loads the root directory into disk_buffer
; Physical address = (segment * 16) + offset
mov si, file_name
call disk_load_file
mov si, help_text
call os_print_string
call os_start_cli
hlt
@@ -19,31 +19,6 @@ start:
halt:
jmp halt
boot_message: db 'OK] Kernel successfully loaded!\n\n', 0
file_name: db 'hello.cws', 0
; Define Fat12 header
bdb_oem: db 'MSWIN4.1' ; ignore
bdb_bytes_per_sector: dw 200h ; = 512d
bdb_sectors_per_cluster: db 01h ; sector = cluster
bdb_reserved_sectors: dw 01h
bdb_fat_count: db 02h ; We've got a fat1 and fat2
bdb_dir_entries_count: dw 0E0h ; Maximum number of root directory entries
bdb_total_sectors: dw 0B40h ; = 2880d
bdb_media_descriptor_type: db 0F0h ; ignore
bdb_sectors_per_fat: dw 09h
bdb_sectors_per_track: dw 12h ; = 18d
bdb_number_of_heads: dw 02h ; top and bottom of the floppy disk
bdb_hidden_sectors: dd 0 ; ignore
bdb_large_sector_count: dd 0 ; total sector count for fat32 (0 for fat12 or fat16)
; extended boot record
ebr_drive_number: db 0 ; ignore
db 0 ; ignore
ebr_signature: db 29h ; boot signature, indicates that the next three fields are present (0x29)
ebr_volume_id: db 12h, 34h, 56h, 78h ; unique id for volume tracking
ebr_volume_label: db 'CrawShaw OS' ; must be 11 bytes
ebr_system_id: db 'FAT12 ' ; must be 8 bytes
; ------------------------------------------------------------------
; FEATURES -- Code to pull into the kernel
@@ -53,9 +28,14 @@ ebr_system_id: db 'FAT12 ' ; must be 8 bytes
%INCLUDE "source/kernel/features/power.asm"
%INCLUDE "source/kernel/features/strings.asm"
%INCLUDE "source/kernel/features/graphics.asm"
%INCLUDE "source/kernel/features/disk.asm"
%INCLUDE "source/kernel/features/math.asm"
%INCLUDE "source/kernel/features/disk.asm"
%INCLUDE "source/kernel/features/math.asm"
%INCLUDE "source/kernel/features/time.asm"
%INCLUDE "source/kernel/features/utils.asm"
; GAMES -- Games that I wrote for it
%INCLUDE "source/kernel/games/pong.asm"
; DATA/VARIABLES
%INCLUDE "source/kernel/data.asm"