Fixed printf
This commit is contained in:
parent
c39cca3f18
commit
8912c5921f
|
|
@ -49,22 +49,23 @@ void printf(char *string, ...){
|
|||
va_start(vars, string);
|
||||
while(*string){
|
||||
if(*string == '%'){
|
||||
int32_t num = 0;
|
||||
char numb[12];
|
||||
switch(*(string + 1)){
|
||||
case 'd':
|
||||
string += 2;
|
||||
int32_t num = va_arg(vars, int32_t);
|
||||
char numb[12];
|
||||
num = va_arg(vars, int32_t);
|
||||
itoa(num, numb, 10);
|
||||
debug_puts(numb);
|
||||
continue;
|
||||
case 'x':
|
||||
// debug_puts(":3");
|
||||
string += 2;
|
||||
int32_t hex = va_arg(vars, int32_t);
|
||||
char hnumb[12];
|
||||
itoa(hex, hnumb, 16);
|
||||
strpad(hnumb, '0', 8);
|
||||
debug_puts(hnumb);
|
||||
num = va_arg(vars, int32_t);
|
||||
// char hnumb[12];
|
||||
itoa(num, numb, 16);
|
||||
strpad(numb, '0', 8);
|
||||
debug_puts(numb);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,12 +7,6 @@
|
|||
#include "drivers/cpuio.h"
|
||||
#include "system/scheduler.h"
|
||||
|
||||
void test(){
|
||||
printf("Hi from another thread!\n");
|
||||
// *((uint16_t*)0xb8000) = 0xf41;
|
||||
for(;;);
|
||||
}
|
||||
|
||||
extern void kmain(kernel_info_t *kernel_info){
|
||||
init_serial();
|
||||
pm_init(kernel_info);
|
||||
|
|
@ -22,10 +16,7 @@ extern void kmain(kernel_info_t *kernel_info){
|
|||
init_scheduler();
|
||||
pic_setmask(0xfe, PIC1_DATA);
|
||||
enable_interrupts();
|
||||
// printf("done\n");
|
||||
thread_start(test, 0);
|
||||
// printf("%x", test);
|
||||
// void test();
|
||||
|
||||
for(;;);
|
||||
return;
|
||||
}
|
||||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
process_t volatile processes[0x10000];
|
||||
uint32_t volatile process_queue[0x10000];
|
||||
uint32_t active_processes;
|
||||
uint32_t volatile active_processes;
|
||||
uint32_t volatile current_pid;
|
||||
uint32_t volatile queue_length;
|
||||
uint32_t volatile current_queue_index;
|
||||
|
|
|
|||
Loading…
Reference in New Issue