Compare commits
No commits in common. "c84e5b55e407c8e7f15f42119cda27e46ae4d91f" and "899e4562496d43c5db2a7afa3e2c470d569effb9" have entirely different histories.
c84e5b55e4
...
899e456249
7 changed files with 27 additions and 84 deletions
|
@ -5,7 +5,6 @@ LOADER_SRCS = loader.asm \
|
|||
../common/bootinfo.inc \
|
||||
../../kernel/sys/bootinfo.inc \
|
||||
../../kernel/sys/register.inc \
|
||||
fat.inc \
|
||||
video.inc \
|
||||
memory.inc \
|
||||
logger.inc \
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
;; File: fat.inc
|
||||
|
||||
include '../common/fat12.inc'
|
||||
|
||||
fat_read_bpb:
|
||||
mov ax, DISK_BUFFER/0x10
|
||||
mov es, ax
|
||||
xor bx, bx
|
||||
mov ax, 0
|
||||
mov cx, 1
|
||||
call disk_read_sectors
|
||||
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.sects_per_track]
|
||||
mov word [sectors_per_track], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.heads_per_cyl]
|
||||
mov word [heads_per_cylinder], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.bytes_per_sects]
|
||||
mov word [bytes_per_sector], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.sects_per_FAT]
|
||||
mov word [sectors_per_FAT], ax
|
||||
mov byte al, [DISK_BUFFER + fat_bpb.FAT_count]
|
||||
mov byte [FAT_count], al
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.reserved_sects]
|
||||
mov word [reserved_sectors], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.root_dir_entries]
|
||||
mov word [root_dir_entries], ax
|
||||
mov byte al, [DISK_BUFFER + fat_bpb.sects_per_clust]
|
||||
mov byte [sectors_per_cluster], al
|
||||
ret
|
||||
|
|
@ -80,7 +80,29 @@ _start:
|
|||
; for now fat12 is asumed
|
||||
.fat_fallback:
|
||||
; get bpb
|
||||
call fat_read_bpb
|
||||
mov ax, DISK_BUFFER/0x10
|
||||
mov es, ax
|
||||
xor bx, bx
|
||||
mov ax, 0
|
||||
mov cx, 1
|
||||
call disk_read_sectors
|
||||
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.sects_per_track]
|
||||
mov word [sectors_per_track], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.heads_per_cyl]
|
||||
mov word [heads_per_cylinder], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.bytes_per_sects]
|
||||
mov word [bytes_per_sector], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.sects_per_FAT]
|
||||
mov word [sectors_per_FAT], ax
|
||||
mov byte al, [DISK_BUFFER + fat_bpb.FAT_count]
|
||||
mov byte [FAT_count], al
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.reserved_sects]
|
||||
mov word [reserved_sectors], ax
|
||||
mov word ax, [DISK_BUFFER + fat_bpb.root_dir_entries]
|
||||
mov word [root_dir_entries], ax
|
||||
mov byte al, [DISK_BUFFER + fat_bpb.sects_per_clust]
|
||||
mov byte [sectors_per_cluster], al
|
||||
|
||||
call fat_load_root
|
||||
|
||||
|
@ -155,7 +177,7 @@ _start:
|
|||
|
||||
include 'a20.inc'
|
||||
include '../common/bios.inc'
|
||||
include 'fat.inc'
|
||||
include '../common/fat12.inc'
|
||||
include 'disk.inc'
|
||||
include 'logger.inc'
|
||||
include 'memory.inc'
|
||||
|
|
|
@ -3,21 +3,6 @@
|
|||
|
||||
# include <stdint.h>
|
||||
|
||||
# define ELF_MAG0 0x7F
|
||||
# define ELF_MAG1 0x45
|
||||
# define ELF_MAG2 0x4C
|
||||
# define ELF_MAG3 0x46
|
||||
|
||||
# define EI_NIDENT 16
|
||||
|
||||
struct elf_header
|
||||
{
|
||||
uint8_t e_ident[EI_NIDENT];
|
||||
uint16_t e_type;
|
||||
uint16_t e_machine;
|
||||
uint32_t e_version;
|
||||
};
|
||||
|
||||
/* TODO */
|
||||
|
||||
#endif /* !ELF_H */
|
||||
|
|
|
@ -32,21 +32,6 @@ proc_alloc:
|
|||
pop eax
|
||||
ret
|
||||
|
||||
context_switch:
|
||||
mov ax, 0x23
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov fs, ax
|
||||
mov gs, ax
|
||||
|
||||
mov eax, esp
|
||||
push 0x23
|
||||
push eax
|
||||
pushf
|
||||
push 0x1b
|
||||
; push addr
|
||||
iret
|
||||
|
||||
uNextpid dd 1
|
||||
uProcLock dd 0
|
||||
pCurrentProc dd 0
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
;; File: shed.inc
|
||||
|
||||
;; Function: schedule
|
||||
schedule:
|
||||
ret
|
|
@ -1,22 +1,9 @@
|
|||
struc Context {
|
||||
.gs dw ?
|
||||
.fs dw ?
|
||||
.es dw ?
|
||||
.ds dw ?
|
||||
.ss dw ?
|
||||
|
||||
.eax dd ?
|
||||
.ebx dd ?
|
||||
.ecx dd ?
|
||||
.edx dd ?
|
||||
.esi dd ?
|
||||
.edi dd ?
|
||||
.esi dd ?
|
||||
.ebx dd ?
|
||||
.ebp dd ?
|
||||
|
||||
.error dd ?
|
||||
.eip dd ?
|
||||
.cs dd ?
|
||||
.eflags dd ?
|
||||
}
|
||||
DEFN Context
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue