Fix/ignore all the warnings

This commit is contained in:
pjht 2019-07-01 15:30:00 -05:00
parent aef1d74750
commit 74cdc67dce
7 changed files with 74 additions and 76 deletions

View File

@ -31,7 +31,7 @@ debug: os.iso kernel/kernel.elf
os.iso: kernel/kernel.elf init vfs initrd/*
@cp kernel/kernel.elf iso/boot
@cd initrd; tar -f ../iso/boot/initrd.tar -c *
@grub-mkrescue -o $@ iso
@grub-mkrescue -o $@ iso >/dev/null 2>/dev/null
init: init/* kernel/start.o
@cd init && make

View File

@ -57,9 +57,12 @@ void vga_write_string(const char* string) {
if (c=='\n') {
x=0;
y++;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-value"
for (int i=0;i<67108864;i++) {
1+1;
}
#pragma GCC diagnostic pop
} else {
set_char(x,y,c);
x++;

View File

@ -88,7 +88,8 @@ void isr_install() {
/* To print the message which defines every exception */
static char *exception_messages[] = {
__attribute__((unused)) static char *exception_messages[] = {
"Division By Zero",
"Debug",
"Non Maskable Interrupt",

View File

@ -32,37 +32,35 @@ void* kmalloc(uint32_t size) {
uint32_t bmap_index;
uint32_t remaining_blks;
for(uint32_t i=0;i<2097152;i++) {
if (bitmap[i]!=0xFF) {
char got_0=0;
remaining_blks=num_4b_grps;
uint32_t old_j;
for (uint32_t j=i*8;;j++) {
char bit=get_bmap_bit(j);
if (got_0) {
if (bit) {
if (remaining_blks==0) {
bmap_index=old_j;
break;
} else {
i+=j/8;
i--;
char got_0=0;
remaining_blks=num_4b_grps;
uint32_t old_j;
for (uint32_t j=i*8;;j++) {
char bit=get_bmap_bit(j);
if (got_0) {
if (bit) {
if (remaining_blks==0) {
bmap_index=old_j;
break;
}
} else {
remaining_blks--;
i+=j/8;
i--;
break;
}
} else {
if (!bit) {
got_0=1;
old_j=j;
remaining_blks--;
}
remaining_blks--;
}
if (remaining_blks==0) {
bmap_index=old_j;
break;
} else {
if (!bit) {
got_0=1;
old_j=j;
remaining_blks--;
}
}
if (remaining_blks==0) {
bmap_index=old_j;
break;
}
}
if (remaining_blks==0) {
break;

View File

@ -69,37 +69,35 @@ void* pmem_alloc(int num_pages) {
uint32_t bmap_index;
uint32_t remaining_blks;
for(uint32_t i=0;i<131072;i++) {
if (bmap[i]!=0xFF) {
char got_0=0;
remaining_blks=num_pages;
uint32_t old_j;
for (uint32_t j=i*8;;j++) {
char bit=get_bmap_bit(j);
if (got_0) {
if (bit) {
if (remaining_blks==0) {
bmap_index=old_j;
break;
} else {
i+=j/8;
i--;
char got_0=0;
remaining_blks=num_pages;
uint32_t old_j;
for (uint32_t j=i*8;;j++) {
char bit=get_bmap_bit(j);
if (got_0) {
if (bit) {
if (remaining_blks==0) {
bmap_index=old_j;
break;
}
} else {
remaining_blks--;
i+=j/8;
i--;
break;
}
} else {
if (!bit) {
got_0=1;
old_j=j;
remaining_blks--;
}
remaining_blks--;
}
if (remaining_blks==0) {
bmap_index=old_j;
break;
} else {
if (!bit) {
got_0=1;
old_j=j;
remaining_blks--;
}
}
if (remaining_blks==0) {
bmap_index=old_j;
break;
}
}
if (remaining_blks==0) {
break;

View File

@ -65,37 +65,35 @@ void* malloc(size_t size) {
char* bmap=entry.bitmap;
uint32_t bmap_byt_sz=entry.bitmap_byt_size;
for(uint32_t i=0;i<bmap_byt_sz;i++) {
if (bmap[i]!=0xFF) {
char got_0=0;
remaining_blks=num_4b_grps;
uint32_t old_j;
for (uint32_t j=i*8;;j++) {
char bit=get_bmap_bit(bmap,j);
if (got_0) {
if (bit) {
if (remaining_blks==0) {
bmap_index=old_j;
break;
} else {
i+=j/8;
i--;
char got_0=0;
remaining_blks=num_4b_grps;
uint32_t old_j;
for (uint32_t j=i*8;;j++) {
char bit=get_bmap_bit(bmap,j);
if (got_0) {
if (bit) {
if (remaining_blks==0) {
bmap_index=old_j;
break;
}
} else {
remaining_blks--;
i+=j/8;
i--;
break;
}
} else {
if (!bit) {
got_0=1;
old_j=j;
remaining_blks--;
}
remaining_blks--;
}
if (remaining_blks==0) {
bmap_index=old_j;
break;
} else {
if (!bit) {
got_0=1;
old_j=j;
remaining_blks--;
}
}
if (remaining_blks==0) {
bmap_index=old_j;
break;
}
}
if (remaining_blks==0) {
break;

View File

@ -2,6 +2,7 @@
#include <ipc/vfs.h>
#include <mailboxes.h>
#include <stdlib.h>
#include <string.h>
#define PROC_FD_LIMIT 1024
@ -77,7 +78,6 @@ uint32_t register_fs(uint32_t drv,const char* type) {
char vfs_fopen(vfs_message* vfs_msg,uint32_t from) {
vfs_mapping* mnt=head_mapping;
vfs_mapping* mntpnt=NULL;
const char* path;
uint32_t mntpnt_len=0;
for (;mnt!=NULL;mnt=mnt->next) {
char* root=mnt->mntpnt;
@ -93,7 +93,7 @@ char vfs_fopen(vfs_message* vfs_msg,uint32_t from) {
char* path_buf=malloc(sizeof(char)*4096);
strcpy(path_buf,&(vfs_msg->path[0]));
memset(&(vfs_msg->path[0]),0,sizeof(char)*4096);
for (int i=0;i<strlen(path_buf)+1-mntpnt_len;i++) {
for (size_t i=0;i<strlen(path_buf)+1-mntpnt_len;i++) {
vfs_msg->path[i]=path_buf[i+mntpnt_len];
}
free(path_buf);