Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamos82 committed May 6, 2024
1 parent 4847d1a commit 78b56f9
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 11 deletions.
1 change: 1 addition & 0 deletions build/Common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ TESTFLAGS := -std=gnu99 \
-I src/include/kernel/arch/x86_64 \
-I src/include/kernel/arch/common/mem \
-I src/include/sys \
-I src/include/utils \
-DSMALL_PAGES=$(SMALL_PAGES) \
-D_TEST_=1

Expand Down
11 changes: 9 additions & 2 deletions tests/test_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ uint32_t _compute_kernel_entries(uint64_t end_of_kernel_area){
printf("kernel_mod_entries: 0x%X\n", kernel_mod_entries);
if ( kernel_mod_entries != 0){
return kernel_entries + 2;
}
}
return kernel_entries + 1;

}

void *map_vaddress(void *address, unsigned int flags){
Expand Down Expand Up @@ -60,6 +60,13 @@ void spinlock_release(spinlock_t *lock) {
return;
}

void hhdm_map_physical_memory() {
}

bool _is_address_in_multiboot(uint64_t address) {
return false;
}

void spinlock_free(spinlock_t* spinlock) {
return;
}
1 change: 1 addition & 0 deletions tests/test_kheap.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct multiboot_tag_basic_meminfo *tagmem;
struct multiboot_tag_mmap *mmap_root;

uint64_t _kernel_end = 0x1190AC;
uint64_t _kernel_physical_end = 0x1190AC;
uint64_t kheap_size = 8 * PAGE_SIZE;

int main(){
Expand Down
17 changes: 9 additions & 8 deletions tests/test_mem.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include <bitmap.h>
#include <kernel.h>
#include <mmap.h>
#include <test_mem.h>
#include <test_common.h>
#include <pmm.h>
#include <multiboot.h>
#include <stdlib.h>
Expand All @@ -8,23 +11,21 @@
#include <stdbool.h>
#include <video.h>
#include <inttypes.h>
#include <test_mem.h>
#include <test_common.h>
#include <main.h>

struct multiboot_tag_basic_meminfo *tagmem;
struct multiboot_tag_mmap *mmap_root;
//unsigned long _kernel_physical_end __attribute__((section(".mySection"))) = 0x9ABCDEF0;
unsigned long _kernel_physical_end = 0x1190AC;
uint64_t _kernel_end = 0x1190AC;

extern uint64_t *memory_map;
extern uint32_t number_of_entries;
extern uint32_t bitmap_size;
extern uint32_t used_frames;
extern uint32_t mmap_number_of_entries;
extern multiboot_memory_map_t *mmap_entries;

struct multiboot_tag_basic_meminfo *tagmem;
struct multiboot_tag_mmap *mmap_root;
//unsigned long _kernel_physical_end __attribute__((section(".mySection"))) = 0x9ABCDEF0;
uint64_t _kernel_end = 0x1190AC;
uint64_t _kernel_physical_end = 0x1190AC;

int main() {
test_pmm_initialize();
test_pmm();
Expand Down
7 changes: 6 additions & 1 deletion tests/test_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ typedef enum {

int main() {
test_is_address_higher_half();
test_ensure_address_in_higher_half();
test_vm_parse_flags();
}


void test_ensure_address_in_higher_half() {

}


void test_is_address_higher_half() {
printf("Testing is address higher_half\n");
Expand Down

0 comments on commit 78b56f9

Please sign in to comment.