Skip to content

Commit

Permalink
Replaced existing memory allocation routine with buddy page allocation.
Browse files Browse the repository at this point in the history
  • Loading branch information
shoily committed May 1, 2023
1 parent 99c5366 commit 3a35d6a
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 115 deletions.
5 changes: 2 additions & 3 deletions debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ int cur_offset;
char *kernel_debug_buffer;
int debug_level_for_vga;

#define DEBUG_BUFFER_SIZE PAGE_SIZE
#define DEBUG_BUFFER_SIZE (PAGE_SIZE << 0)

void debug_init() {

kernel_debug_buffer = page_alloc_kmap_linear(DEBUG_BUFFER_SIZE >> PAGE_SHIFT);
kernel_debug_buffer = page_alloc_kmap_linear(NPAGES_TO_ORDER(DEBUG_BUFFER_SIZE >> PAGE_SHIFT));
cur_debug_mem = kernel_debug_buffer;
cur_offset = 0;
debug_level_for_vga = KERNEL_DEBUG;
Expand Down
3 changes: 2 additions & 1 deletion kernel32.ld
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ SECTIONS
_kernel_stack_0 = .;
_kernel_stack_0_start = _kernel_stack_0 + 0x2000;
_kernel_stack_end = _kernel_stack_0_start + (0x2000 * 32);
. = ALIGN(0x400000);
. = _kernel_stack_end;
. = ALIGN(0x1000);
_master_kernel_pg_dir = .;
_kernel_pg_dir = _master_kernel_pg_dir + 0x1000;
_kernel_pg_dir_end = _kernel_pg_dir + (0x1000 * 32);
Expand Down
Loading

0 comments on commit 3a35d6a

Please sign in to comment.