Add free_sector
This commit is contained in:
parent
ffe6eb0904
commit
abe7d1c5f4
@ -128,6 +128,7 @@ free:
|
||||
ret
|
||||
|
||||
; Allocate a sector, 512 bytes or 32 paragraphs
|
||||
; OUT BX ptr to sector
|
||||
malloc_sector:
|
||||
call malloc_get_table
|
||||
mov cx, 0x0200
|
||||
@ -152,6 +153,16 @@ malloc_sector:
|
||||
xchg bx, di
|
||||
ret
|
||||
|
||||
; Free a sector
|
||||
; IN BX ptr to sector
|
||||
free_sector:
|
||||
call malloc_calc_offsets
|
||||
xor ax, ax
|
||||
add di, bx
|
||||
stosw
|
||||
stosw
|
||||
ret
|
||||
|
||||
fatal_oom:
|
||||
call printf
|
||||
db "PANIC OOM", 0x0A, 0x0D, 0x00
|
||||
|
Loading…
Reference in New Issue
Block a user