Fix sign errors, make JMK2 show relative paths
diff --git a/src/kernel/Jmk2 b/src/kernel/Jmk2
index 57a657a..39d795f 100644
--- a/src/kernel/Jmk2
+++ b/src/kernel/Jmk2
@@ -4,7 +4,7 @@
presets freestanding debug warn
-cflags -I$root/include/kernel -I$root/include -I[pwd] -O0 -Wno-ignored-qualifiers -Wno-unused-params -Wno-sign-compare
+cflags -I$root/include/kernel -I$root/include -I[pwd] -O0 -Wno-ignored-qualifiers -Wno-unused-params
# Sources are mostly platform dependent (for now ;D )
enable_multiplat
diff --git a/src/kernel/dri/fs/ext2/ext2.c b/src/kernel/dri/fs/ext2/ext2.c
index 99d5e9d..b526e8f 100644
--- a/src/kernel/dri/fs/ext2/ext2.c
+++ b/src/kernel/dri/fs/ext2/ext2.c
@@ -417,7 +417,7 @@
const uint block_size = ext2_block_size(sb);
char transfer[block_size];
- uint fsize = MIN(inode->size, size);
+ uint fsize = MIN(inode->size, (uint)size);
uint i;
// Transfer full blocks straight to the output buffer
@@ -478,8 +478,8 @@
return true;
}
-static const uint ext2_bitmap_block(struct ext2_superblock *sb,
- uint *bitmap_block, uint *index)
+static uint ext2_bitmap_block(struct ext2_superblock *sb,
+ uint *bitmap_block, uint *index)
{
const uint block_size = ext2_block_size(sb);
@@ -539,7 +539,7 @@
ext2_read_block(sb, buffer, block);
// If this is the first block start at start_at, otherwise 0
- for (int i = 0; i < block_size / 4; i++)
+ for (uint i = 0; i < block_size / 4; i++)
{
// The bitwise negative will be non-zero if there are zero bits in
// the original.
@@ -577,7 +577,7 @@
kprintf(INFO "%d block groups\n", num_block_groups);
- for (int bg_num = 0; bg_num < num_block_groups; bg_num++)
+ for (uint bg_num = 0; bg_num < num_block_groups; bg_num++)
{
struct ext2_block_group_descriptor bgd =
ext2_load_bgd(sb, 0);
@@ -607,7 +607,7 @@
{
uint num_block_groups = ext2_num_block_groups(sb);
- for (int bg_num = 0; bg_num < num_block_groups; bg_num++)
+ for (uint bg_num = 0; bg_num < num_block_groups; bg_num++)
{
struct ext2_block_group_descriptor bgd =
ext2_load_bgd(sb, 0);
diff --git a/src/kernel/dri/pci/pci.c b/src/kernel/dri/pci/pci.c
index bb0b36c..df958b1 100644
--- a/src/kernel/dri/pci/pci.c
+++ b/src/kernel/dri/pci/pci.c
@@ -119,7 +119,7 @@
// Do any drivers support this?
- for (int i = 0; i < num_drivers; i++)
+ for (uint i = 0; i < num_drivers; i++)
{
if (drivers[i].supports(&dev))
{
@@ -136,9 +136,9 @@
void pci_print_drivers()
{
kprintf(INFO "Enumerating PCI device drivers:\n");
- for (int i = 0; i < num_drivers; i++)
+ for (uint i = 0; i < num_drivers; i++)
{
- for (int j = 0; j < drivers[i].loaded; j++)
+ for (uint j = 0; j < drivers[i].loaded; j++)
{
struct pci_device_driver d = drivers[i];
kprintf(INFO "Driver: %s, vendor: %s\n", d.generic_name, d.dev.vendor->name);
diff --git a/src/kernel/x86_32/descriptor_tables.c b/src/kernel/x86_32/descriptor_tables.c
index 339162e..56ea13f 100644
--- a/src/kernel/x86_32/descriptor_tables.c
+++ b/src/kernel/x86_32/descriptor_tables.c
@@ -47,6 +47,7 @@
e->access = access;
}
+/*
static void init_tss(uint num, uint ss, uint esp)
{
gdt_set_gate(num, (uint)&tss_entry, (uint)&tss_entry+1, 0xe9, 0x00);
@@ -60,6 +61,7 @@
// can switch to kernel mode using this tss
tss_entry.ss = tss_entry.ds = tss_entry.es = tss_entry.fs = tss_entry.gs = 0x13;
}
+*/
void init_gdt()
{
diff --git a/src/kernel/x86_32/main.c b/src/kernel/x86_32/main.c
index 4d3d868..e1963e8 100644
--- a/src/kernel/x86_32/main.c
+++ b/src/kernel/x86_32/main.c
@@ -75,7 +75,7 @@
#ifdef TEST_THREADS
kprintf(DEBUG "Spawning test thread\n");
- spawn_thread(other_thread, NULL);
+ spawn_thread((task_function_t)other_thread, NULL);
greet();
#endif
diff --git a/src/kernel/x86_32/paging.c b/src/kernel/x86_32/paging.c
index c77f499..ff6226b 100644
--- a/src/kernel/x86_32/paging.c
+++ b/src/kernel/x86_32/paging.c
@@ -17,7 +17,6 @@
/* frames bitset, 0 = free, 1 = used */
static uint frames[NUM_FRAMES];
-static uint first_page_table[1024] __attribute__((aligned(4096)));
uint kernel_page_directory[1024] __attribute__((aligned(4096)));
@@ -31,12 +30,6 @@
frames[frame / BITS] |= 1 << (frame % BITS);
}
-static bool test_frame(size_t frame_addr)
-{
- uint frame = frame_addr / 0x1000; // page aligned
- return frames[frame / BITS] & 1 << (frame % BITS);
-}
-
static void clear_frame(size_t frame_addr)
{
uint frame = frame_addr / 0x1000; // page aligned
@@ -90,7 +83,6 @@
void map_4mb(uint *dir, size_t virt_start, size_t phys_start, bool user,
bool rw)
{
- uint page = virt_start / 0x1000;
uint table = virt_start >> 22;
for (uint i = 0; i < 1024 * 0x1000; i += 0x1000)
@@ -238,6 +230,7 @@
load_page_directory(VIRT_TO_PHYS(kernel_page_directory));
}
+#ifdef TEST_PAGING
void test_paging()
{
// a random page base address
@@ -252,3 +245,4 @@
base[i] = i;
}
}
+#endif
diff --git a/src/kernel/x86_32/timer.c b/src/kernel/x86_32/timer.c
index 0e52d0e..59af51d 100644
--- a/src/kernel/x86_32/timer.c
+++ b/src/kernel/x86_32/timer.c
@@ -5,8 +5,6 @@
#include "registers.h"
#include "task.h"
-static ulong tick = 0;
-
static void timer_cb(struct registers *regs)
{
if (tasks_initialized)