aboutsummaryrefslogtreecommitdiff
path: root/kernel/memory/frame.sats
blob: 6580ab0d65c77fe0c399610303a7d9a0ab59c717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#define PAGE_SIZE 4096

staload "kernel/bootinfo/multiboot.sats"

// Physical address type
typedef paddr = Ptr0

typedef frame_t = @{
  num = size_t
}

typedef frame_allocator_t = @{
  next_free_frame = frame_t,
  current_area = memory_area_t,
  kernel_start = frame_t,
  kernel_end = frame_t,
  multiboot_start = frame_t,
  multiboot_end = frame_t
}

fn containing_address{l:addr}(ptr l):<> frame_t
fn start_address(frame_t):<> paddr

fn allocate_frame () : frame_t
fn deallocate_frame () : void
fn init(kernel_start: Ptr, kernel_end: Ptr, multiboot_start:Ptr, multiboot_end: Ptr) : void