summaryrefslogtreecommitdiff
path: root/src/kernel/proc.c
diff options
context:
space:
mode:
authorBenji Dial <Benji3.141@gmail.com>2019-12-24 22:31:22 -0500
committerBenji Dial <Benji3.141@gmail.com>2019-12-24 22:31:22 -0500
commitf5f0f5ddae199121daebcd2213aabd81686cc074 (patch)
tree91d8d29ea497e282f841849e620d43f8fcafcfcc /src/kernel/proc.c
parenta947a7a143029ee8ef5cb4a4232d7439b8a79670 (diff)
downloadportland-os-f5f0f5ddae199121daebcd2213aabd81686cc074.tar.gz
start of 0.0.9 branch, using multiboot this time
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r--src/kernel/proc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index a0fb863..84075d7 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -25,9 +25,10 @@ uint16_t new_proc(uint8_t *file) {
uint16_t handle = open_file(file);
if (handle)
for (uint16_t id = 3; id; ++id)
- if (!PROCS[id].memory_start) {
+ if (!proc_table[id].memory_start) {
uint32_t size = get_size(id);
- void *mem = PROCS[id].memory_start = allocate_pages(PROCS[id].n_pages = (size - 1) / 4096 + 1, id);
+ void *mem;
+ proc_table[id].memory_end = size + (proc_table[id].memory_start = allocate_block(size, id));
read_file(handle, size, mem);
close_file(handle);
//Process file header and make new process
@@ -38,6 +39,6 @@ uint16_t new_proc(uint8_t *file) {
}
void end_proc(uint16_t id) {
- deallocate_pages(PROCS[id].memory_start, PROCS[id].n_pages);
- PROCS[id].memory_start = 0;
+ deallocate_block(proc_table[id].memory_start);
+ proc_table[id].memory_start = 0;
} \ No newline at end of file