chore: sync repo

This commit is contained in:
d0p1 🏳️‍⚧️ 2024-08-18 14:19:28 +02:00
parent e0ab3e5c1a
commit c84e5b55e4
4 changed files with 51 additions and 3 deletions

View file

@ -3,6 +3,21 @@
# include <stdint.h> # 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 */ /* TODO */
#endif /* !ELF_H */ #endif /* !ELF_H */

View file

@ -32,6 +32,21 @@ proc_alloc:
pop eax pop eax
ret 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 uNextpid dd 1
uProcLock dd 0 uProcLock dd 0
pCurrentProc dd 0 pCurrentProc dd 0

5
kernel/sched.inc Normal file
View file

@ -0,0 +1,5 @@
;; File: shed.inc
;; Function: schedule
schedule:
ret

View file

@ -1,9 +1,22 @@
struc Context { struc Context {
.edi dd ? .gs dw ?
.esi dd ? .fs dw ?
.es dw ?
.ds dw ?
.ss dw ?
.eax dd ?
.ebx dd ? .ebx dd ?
.ecx dd ?
.edx dd ?
.esi dd ?
.edi dd ?
.ebp dd ? .ebp dd ?
.eip dd ?
.error dd ?
.eip dd ?
.cs dd ?
.eflags dd ?
} }
DEFN Context DEFN Context