Fix warnings

This commit is contained in:
pjht 2019-04-13 09:23:40 -05:00
parent 97f18478ed
commit e3fd4fd5e1
7 changed files with 16 additions and 14 deletions

View File

@ -178,7 +178,7 @@ void isr_handler(registers_t r) {
} else if (r.eax==4) {
alloc_pages_virt(r.ebx,(void*)r.ecx);
} else if (r.eax==5) {
r.ebx=tasking_get_errno_address();
r.ebx=(uint32_t)tasking_get_errno_address();
}
break;
}

View File

@ -6,7 +6,9 @@
#include "kmalloc.h"
#include "memory.h"
#include "gdt.h"
#include "paging.h"
#include <stdint.h>
#include <stdlib.h>
#define STACK_PAGES 2
uint32_t next_pid;
@ -37,7 +39,7 @@ static Task* createTaskKmode(void* eip,char kmode) {
uint32_t cr3;
asm volatile("movl %%cr3, %%eax; movl %%eax, %0;":"=m"(cr3)::"%eax");
load_address_space(task->regs.cr3);
task->regs.esp=((uint32_t)alloc_memory(1))+0xfff;
task->regs.esp=((uint32_t)alloc_pages(1))+0xfff;
load_address_space(cr3);
task->regs.ebp=0;
task->msg_store=NULL;

View File

@ -12,9 +12,9 @@
static uint8_t ident[4][512];
static uint8_t* sect_data=NULL;
static uint32_t last_read_sector=0;
static uint32_t last_read_base=0;
static uint32_t last_read_slave=0;
static uint8_t* read_sect(int base,int slave,int lba) {
static int last_read_base=0;
static int last_read_slave=0;
static uint8_t* read_sect(int base,int slave,uint32_t lba) {
if (last_read_sector==lba && last_read_base==base && last_read_slave==slave && sect_data) {
return sect_data;
}
@ -43,8 +43,9 @@ static uint8_t* read_sect(int base,int slave,int lba) {
return sect;
}
static void write_sect(int base,int slave,int lba,uint8_t* sect) {
if (last_read_sector==lba && last_read_base==base && last_read_slave==slave) {
static void write_sect(int base,int slave,uint32_t lba,uint8_t* sect) {
kslog("INFO","Writing sector %x",lba);
if (last_read_sector==lba && last_read_base==base && last_read_slave==slave && sect_data) {
sect_data=sect;
}
if (!sect_data) {
@ -89,14 +90,14 @@ static int drv(char* filename,int c,long pos,char wr) {
slave=1;
}
if (wr) {
int lba=pos/512;
uint32_t lba=pos/512;
int offset=pos%512;
uint8_t* sect=read_sect(base,slave,lba);
sect[offset]=(uint8_t)c;
write_sect(base,slave,lba,sect);
return 0;
} else {
int lba=pos/512;
uint32_t lba=pos/512;
int offset=pos%512;
uint8_t* sect=read_sect(base,slave,lba);
uint8_t val=sect[offset];

View File

@ -6,7 +6,7 @@
static char** names;
static uint32_t* offsets;
static long* sizes;
static unsigned long* sizes;
static uint32_t num_files;
static FILE* initrd_fd;

View File

@ -10,7 +10,6 @@ void* alloc_memory(uint32_t num_pages) {
}
void alloc_memory_virt(uint32_t num_pages,void* addr) {
void* address;
asm volatile(" \
mov $4, %%eax; \
int $80; \

View File

@ -102,7 +102,7 @@ void backspace(char* s) {
s[len-1] = '\0';
}
static char* strtok_str=NULL;
static const char* strtok_str=NULL;
static size_t strtok_index;
static char strtok_delim_check(const char* delim) {
@ -114,7 +114,7 @@ static char strtok_delim_check(const char* delim) {
return 1;
}
char* strtok(char* str, const char* delim) {
char* strtok(const char* str, const char* delim) {
if (str!=NULL) {
strtok_str=str;
strtok_index=0;

View File

@ -7,7 +7,7 @@ void* memset(void* dest,int val,size_t len);
int strcmp(const char* s1,const char* s2);
size_t strlen(const char* str);
char* strcpy(char* dest,const char* src);
char* strtok(char* str, const char* delim);
char* strtok(const char* str, const char* delim);
char* strrev(char *str);
void int_to_ascii(int n,char* str);