~swisschili/bluejay

d00ec61d4d75300330c0d27a381acf263a528505 — swissChili 3 months ago 1e8b756
Begin tasking v3 rewrite
5 files changed, 9 insertions(+), 7 deletions(-)

M src/kernel/Jmk
M src/kernel/dri/ide/ide.c
M src/kernel/dri/pci/pci.c
M src/kernel/main.c
M src/kernel/task.c
M src/kernel/Jmk => src/kernel/Jmk +1 -1
@@ 27,7 27,7 @@ test_defines = $(TEST:%=-DTEST_%)

FS ?= ext2

CFLAGS += -I$(ROOT)/include/kernel $(test_defines) -O0
CFLAGS += -I$(ROOT)/include/kernel $(test_defines) -O0 -Wno-ignored-qualifiers -Wno-sign-compare

LDFLAGS += -Tlink.ld -melf_i386
ASMFLAGS += -felf -Fdwarf

M src/kernel/dri/ide/ide.c => src/kernel/dri/ide/ide.c +1 -1
@@ 17,7 17,7 @@ bool ide_supports(struct pci_device *dev)

void ide_print_device(struct ide_device *dev)
{
	kprintf(INFO "<ide-device dma=%b>\n", dev->supports_dma);
	kprintf(INFO "IDE device dma=%b\n", dev->supports_dma);
}

void ide_thread(struct ide_thread_data *data)

M src/kernel/dri/pci/pci.c => src/kernel/dri/pci/pci.c +1 -0
@@ 19,6 19,7 @@ uint pci_config_readd(uchar bus, uchar slot, uchar func, uchar offset)

struct pci_device pci_check_device(uchar bus, uchar slot, uchar func)
{

	uint vendor_device = pci_config_readd(bus, slot, func, 0);
	ushort vendor = vendor_device & 0xffff;


M src/kernel/main.c => src/kernel/main.c +4 -3
@@ 47,11 47,12 @@ int kmain(struct multiboot_info *mboot)
	test_allocator();
#endif

	// Load initrd
	struct multiboot_info mb = make_multiboot_physical(mboot);
	init_vfs();

#ifdef INITRD
	// Load initrd
	struct multiboot_info mb = make_multiboot_physical(mboot);

	kassert(mb.mods_count, "No multiboot modules loaded!");
	kprintf(DEBUG "mboot->mods_addr = %d (0x%x)\n", mb.mods_addr, mb.mods_addr);
	uchar *initrd_loc = (uchar *)((uint *)mb.mods_addr)[0];


@@ 64,7 65,7 @@ int kmain(struct multiboot_info *mboot)

	asm("sti");

	init_tasks();
	// init_tasks();
	init_sync();

	pci_init();

M src/kernel/task.c => src/kernel/task.c +2 -2
@@ 85,8 85,8 @@ void spawn_thread(void (*function)(void *), void *data)
	// Virtual address of page directory (in kernel memory)
	uint *dir_v = PHYS_TO_VIRT(proc->page_directory_p);

	// Virtual location of new stack, with space reserved for argument and
	// return address to kill_this_thread().
	// Virtual location of new stack, with space reserved for argument
	// and return address to kill_this_thread().
	uint new_stack_base_v = proc->last_stack_pos;
	proc->last_stack_pos -= 0x1000;