aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarvin Borner2020-04-21 00:37:02 +0200
committerMarvin Borner2020-04-21 00:45:47 +0200
commitc83104329214bd618444d6e0242bb0317f52dbbc (patch)
tree8f884d12483f21e94ace5b60d353ad9c8fc14a7c /src
parent62b27d5307b1ac019a0a3a27fe947cccff8875f6 (diff)
Finally! EXT2 is working now :)
Puuh.
Diffstat (limited to 'src')
-rw-r--r--src/kernel/fs/ext2.c5
-rw-r--r--src/kernel/fs/load.c2
-rw-r--r--src/kernel/graphics/vesa.c10
-rw-r--r--src/kernel/io/io.c12
-rw-r--r--src/kernel/kernel.c1
-rw-r--r--src/kernel/memory/paging.c2
6 files changed, 15 insertions, 17 deletions
diff --git a/src/kernel/fs/ext2.c b/src/kernel/fs/ext2.c
index 7ce0601..c95c134 100644
--- a/src/kernel/fs/ext2.c
+++ b/src/kernel/fs/ext2.c
@@ -36,7 +36,7 @@ void ext2_init_fs()
struct ext2_dirent dirent;
while (ext2_next_dirent(&file, &dirent))
- log("Inode %d, name `%s'", dirent.inode_num, dirent.name);
+ log("Inode %d, name '%s'", dirent.inode_num, dirent.name);
kfree(file.buf);
@@ -46,7 +46,6 @@ void ext2_init_fs()
log("File not found");
else
log("Found: inode = %d", inode);
- panic("nice");
}
static void read_block(uint32_t block_num, void *buf)
@@ -70,7 +69,7 @@ static void load_superblock()
assert(superblock.signature == EXT2_SIGNATURE);
log("Total inodes = 0x%x", superblock.total_inodes);
log("Total blocks = 0x%x", superblock.total_blocks);
- log("Block size = %b", block_size);
+ log("Block size = %d", block_size);
log("Num blocks = %d", superblock.total_blocks);
log("Blocks/group = %d", superblock.blocks_per_group);
log("Inodes/group = %d", superblock.inodes_per_group);
diff --git a/src/kernel/fs/load.c b/src/kernel/fs/load.c
index 7f5340a..9aca1c3 100644
--- a/src/kernel/fs/load.c
+++ b/src/kernel/fs/load.c
@@ -31,5 +31,5 @@ void load_binaries()
halt_loop();
}
}*/
- vga_log("Successfully loaded binaries");
+ log("Successfully loaded binaries");
} \ No newline at end of file
diff --git a/src/kernel/graphics/vesa.c b/src/kernel/graphics/vesa.c
index 926c34a..853c503 100644
--- a/src/kernel/graphics/vesa.c
+++ b/src/kernel/graphics/vesa.c
@@ -104,8 +104,8 @@ struct vbe_mode_info *vbe_get_mode_info(uint16_t mode)
void set_optimal_resolution()
{
- vga_log("Switching to graphics mode");
- vga_log("Trying to detect available modes");
+ log("Switching to graphics mode");
+ log("Trying to detect available modes");
uint16_t *video_modes = vbe_get_modes();
uint16_t highest = 0;
@@ -135,8 +135,8 @@ void set_optimal_resolution()
kfree(video_modes);
if (highest == 0) {
- vga_log("Mode detection failed!");
- vga_log("Trying common modes...");
+ log("Mode detection failed!");
+ log("Trying common modes...");
struct vbe_mode_info *mode_info;
int modes[] = {
322, 287, 286, 285, 284, // 1600x1200
@@ -177,7 +177,7 @@ void set_optimal_resolution()
if (highest == 0)
switch_to_vga();
} else {
- vga_log("Mode detection succeeded");
+ log("Mode detection succeeded");
}
vbe_set_mode(highest);
diff --git a/src/kernel/io/io.c b/src/kernel/io/io.c
index 803a78a..cd03408 100644
--- a/src/kernel/io/io.c
+++ b/src/kernel/io/io.c
@@ -4,21 +4,21 @@
uint8_t inb(uint16_t port)
{
uint8_t value;
- asm("inb %1, %0" : "=a"(value) : "Nd"(port));
+ asm volatile("inb %1, %0" : "=a"(value) : "Nd"(port));
return value;
}
uint16_t inw(uint16_t port)
{
uint16_t value;
- asm("inw %1, %0" : "=a"(value) : "Nd"(port));
+ asm volatile("inw %1, %0" : "=a"(value) : "Nd"(port));
return value;
}
uint32_t inl(uint16_t port)
{
uint32_t value;
- asm("inl %1, %0" : "=a"(value) : "Nd"(port));
+ asm volatile("inl %1, %0" : "=a"(value) : "Nd"(port));
return value;
}
@@ -39,17 +39,17 @@ void hlt()
void outb(uint16_t port, uint8_t data)
{
- asm("outb %0, %1" ::"a"(data), "Nd"(port));
+ asm volatile("outb %0, %1" ::"a"(data), "Nd"(port));
}
void outw(uint16_t port, uint16_t data)
{
- asm("outw %0, %1" ::"a"(data), "Nd"(port));
+ asm volatile("outw %0, %1" ::"a"(data), "Nd"(port));
}
void outl(uint16_t port, uint32_t data)
{
- asm("outl %0, %1" ::"a"(data), "Nd"(port));
+ asm volatile("outl %0, %1" ::"a"(data), "Nd"(port));
}
void init_serial()
diff --git a/src/kernel/kernel.c b/src/kernel/kernel.c
index 84ed953..57b853f 100644
--- a/src/kernel/kernel.c
+++ b/src/kernel/kernel.c
@@ -57,7 +57,6 @@ void kernel_main(uint32_t magic, uint32_t multiboot_address)
ata_init();
ext2_init_fs();
- panic("YAY");
load_binaries();
set_optimal_resolution();
diff --git a/src/kernel/memory/paging.c b/src/kernel/memory/paging.c
index 99160d0..d859efc 100644
--- a/src/kernel/memory/paging.c
+++ b/src/kernel/memory/paging.c
@@ -78,7 +78,7 @@ void paging_switch_directory(int user)
asm("mov %0, %%cr3" ::"r"(current_page_directory));
}
-inline void invlpg(uint32_t addr)
+void invlpg(uint32_t addr)
{
asm("invlpg (%0)" ::"r"(addr) : "memory");
}