got some of the pty actually working in userspace
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
#include "elf.h"
|
||||
#include "vfs.h"
|
||||
#include "memory/mm.h"
|
||||
#include "process.h"
|
||||
#include "scheduler.h"
|
||||
|
||||
#include <lib/memory.h>
|
||||
#include <lib/print.h>
|
||||
|
||||
uint32_t load_elf_program(const char* prgm) {
|
||||
int fd = vfs_open(prgm, 0);
|
||||
if (fd == -1) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
elf_header_t* e_hdr = kalloc(sizeof(elf_header_t));
|
||||
@@ -15,12 +18,12 @@ uint32_t load_elf_program(const char* prgm) {
|
||||
|
||||
uint32_t bytes_rd = vfs_read(fd, e_hdr, sizeof(elf_header_t));
|
||||
if (bytes_rd <= 0) {
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t ph_table_ptr = e_hdr->e_phoff;
|
||||
elf_program_header_t* ph = kalloc(sizeof(elf_program_header_t));
|
||||
uint32_t heap_start = 0;
|
||||
uint32_t heap_start = 0;
|
||||
|
||||
for (uint32_t i = 0; i < e_hdr->e_phnum; i++) {
|
||||
vfs_seek(fd, ph_table_ptr);
|
||||
|
||||
Reference in New Issue
Block a user