-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kheap and pmm, plus we can list directories now! As well, some bugfixes with the ext2 filesystem inode read.
- Loading branch information
Showing
57 changed files
with
1,191 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ext2.img | ||
commit.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,3 @@ | ||
set timeout=0 | ||
set default=0 | ||
|
||
menuentry "SimpleOS" { | ||
multiboot /boot/SimpleOS.bin | ||
boot | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#ifndef KHEAP_H | ||
#define KHEAP_H | ||
|
||
#include "types.h" | ||
|
||
// a singly linked list heap block | ||
typedef struct _kheap_block { | ||
struct { | ||
uint32 size; // memory size | ||
uint8 is_free; // block is free or not | ||
} metadata; | ||
struct _kheap_block *next; | ||
void *data; // data pointer | ||
} __attribute__((packed)) KHEAP_BLOCK; | ||
|
||
/** | ||
* initialize heap and set total memory size | ||
*/ | ||
int kheap_init(void *start_addr, void *end_addr); | ||
|
||
/** | ||
* increase the heap memory by size & get its address | ||
*/ | ||
void *kbrk(int size); | ||
|
||
/** | ||
* print list of allocated blocks | ||
*/ | ||
void kheap_print_blocks(); | ||
|
||
/** | ||
* allocate given size if list is null | ||
* otherwise try some memory allocation algorithm like best fit etc | ||
* to find best block to allocate | ||
* # Need to work on internal/external segmentaion problem | ||
*/ | ||
void *kmalloc(int size); | ||
|
||
/** | ||
* allocate memory n * size & zeroing out | ||
*/ | ||
void *kcalloc(int n, int size); | ||
|
||
/** | ||
* allocate a new block of memory | ||
* copy previous block data & set free the previous block | ||
*/ | ||
void *krealloc(void *ptr, int size); | ||
|
||
/** | ||
* set free the block | ||
*/ | ||
void kfree(void *addr); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.