mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2025-12-17 12:24:37 +03:00
lesson 23, step 3
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "kernel.h"
|
||||
#include "../libc/string.h"
|
||||
#include "../libc/mem.h"
|
||||
#include <stdint.h>
|
||||
|
||||
void kernel_main() {
|
||||
isr_install();
|
||||
@@ -18,8 +19,8 @@ void user_input(char *input) {
|
||||
asm volatile("hlt");
|
||||
} else if (strcmp(input, "PAGE") == 0) {
|
||||
/* Lesson 22: Code to test kmalloc, the rest is unchanged */
|
||||
u32 phys_addr;
|
||||
u32 page = kmalloc(1000, 1, &phys_addr);
|
||||
uint32_t phys_addr;
|
||||
uint32_t page = kmalloc(1000, 1, &phys_addr);
|
||||
char page_str[16] = "";
|
||||
hex_to_ascii(page, page_str);
|
||||
char phys_str[16] = "";
|
||||
|
||||
Reference in New Issue
Block a user