aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorMarvin Borner2021-05-15 22:36:21 +0200
committerMarvin Borner2021-05-15 22:36:21 +0200
commitdf5a8c5b32733ae5e2d872b1c7baa4311a9d2308 (patch)
tree460b35ad421bc74e75e942a35379621ba168c9ea /kernel
parentf97343c268b0fc19bf93d509a019f3d13c7af5a4 (diff)
Strange fixes
I have no ideas halp
Diffstat (limited to 'kernel')
-rw-r--r--kernel/features/fs.c2
-rw-r--r--kernel/features/load.c4
-rw-r--r--kernel/features/net.c2
-rw-r--r--kernel/features/proc.c2
-rw-r--r--kernel/inc/proc.h2
5 files changed, 4 insertions, 8 deletions
diff --git a/kernel/features/fs.c b/kernel/features/fs.c
index fdd5154..923ab7c 100644
--- a/kernel/features/fs.c
+++ b/kernel/features/fs.c
@@ -240,12 +240,12 @@ static struct ext2_inode *ext2_get_inode(u32 i, struct ext2_inode *in_buf, struc
struct ext2_superblock *s = ext2_get_superblock(dev);
assert(s);
struct ext2_bgd *b = ext2_get_bgd(dev);
- assert(b);
u32 block_group = (i - 1) / s->inodes_per_group;
u32 index = (i - 1) % s->inodes_per_group;
u32 block = (index * EXT2_INODE_SIZE) / BLOCK_SIZE;
b += block_group;
+ assert(b);
u32 *buf = ext2_buffer_read(b->inode_table + block, dev);
struct ext2_inode *in =
diff --git a/kernel/features/load.c b/kernel/features/load.c
index d6e387e..645c4d2 100644
--- a/kernel/features/load.c
+++ b/kernel/features/load.c
@@ -66,7 +66,6 @@ res elf_load(const char *name, struct proc *proc)
if (vfs_read(path, &program, header.phoff + header.phentsize * i,
sizeof(program)) != sizeof(program)) {
memory_bypass_disable();
- clac();
return -ENOEXEC;
}
memory_bypass_disable();
@@ -107,7 +106,6 @@ res elf_load(const char *name, struct proc *proc)
if (vfs_read(path, &section_strings, header.shoff + header.shentsize * header.shstrndx,
sizeof(section_strings)) != sizeof(section_strings)) {
memory_bypass_disable();
- clac();
return -ENOEXEC;
}
memory_bypass_disable();
@@ -122,7 +120,6 @@ res elf_load(const char *name, struct proc *proc)
if (vfs_read(path, &section, header.shoff + header.shentsize * i,
sizeof(section)) != sizeof(section)) {
memory_bypass_disable();
- clac();
return -ENOEXEC;
}
memory_bypass_disable();
@@ -135,7 +132,6 @@ res elf_load(const char *name, struct proc *proc)
/* char name[64] = { 0 }; // Max length? */
/* if (vfs_read(path, &name, offset, sizeof(name)) != sizeof(name)) { */
/* memory_bypass_disable(); */
- /* clac(); */
/* return -ENOEXEC; */
/* } */
/* memory_bypass_disable(); */
diff --git a/kernel/features/net.c b/kernel/features/net.c
index 48cbf55..6c971cd 100644
--- a/kernel/features/net.c
+++ b/kernel/features/net.c
@@ -8,7 +8,7 @@
#include <net.h>
#include <pci.h>
#include <print.h>
-#include <random.h>
+#include <rand.h>
#include <rtl8139.h>
#include <socket.h>
#include <str.h>
diff --git a/kernel/features/proc.c b/kernel/features/proc.c
index 3dd8114..c6de9c0 100644
--- a/kernel/features/proc.c
+++ b/kernel/features/proc.c
@@ -320,7 +320,7 @@ static res procfs_perm(const char *path, enum vfs_perm perm, struct vfs_dev *dev
extern void proc_jump_userspace(void);
u32 _esp, _eip;
-NORETURN void proc_init(void)
+void proc_init(void)
{
if (proc_list_running)
panic("Already initialized processes!");
diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h
index 242a8d4..582ca22 100644
--- a/kernel/inc/proc.h
+++ b/kernel/inc/proc.h
@@ -52,7 +52,7 @@ struct proc {
};
void scheduler(struct regs *regs) NONNULL;
-void proc_init(void);
+NORETURN void proc_init(void);
void proc_print(void);
struct proc *proc_current(void);
u8 proc_super(void);