Commit c7c584f8 authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

rename main to kernel_main to fix warnings

Newer gcc versions generate warnings because of the noreturn attribute on it and
different type signature.
parent 4e5f7110
...@@ -70,11 +70,11 @@ static void locate_block_devices (void); ...@@ -70,11 +70,11 @@ static void locate_block_devices (void);
static void locate_block_device (enum block_type, const char *name); static void locate_block_device (enum block_type, const char *name);
#endif #endif
int main (void) NO_RETURN; int kernel_main (void) NO_RETURN;
/* Pintos main program. */ /* Pintos main program. */
int int
main (void) kernel_main (void)
{ {
char **argv; char **argv;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#### The loader (in loader.S) loads the kernel at physical address #### The loader (in loader.S) loads the kernel at physical address
#### 0x20000 (128 kB) and jumps to "start", defined here. This code #### 0x20000 (128 kB) and jumps to "start", defined here. This code
#### switches from real mode to 32-bit protected mode and calls #### switches from real mode to 32-bit protected mode and calls
#### main(). #### kernel_main().
/* Flags in control register 0. */ /* Flags in control register 0. */
#define CR0_PE 0x00000001 /* Protection Enable. */ #define CR0_PE 0x00000001 /* Protection Enable. */
...@@ -173,13 +173,13 @@ start: ...@@ -173,13 +173,13 @@ start:
mov %ax, %gs mov %ax, %gs
mov %ax, %ss mov %ax, %ss
addl $LOADER_PHYS_BASE, %esp addl $LOADER_PHYS_BASE, %esp
movl $0, %ebp # Null-terminate main()'s backtrace movl $0, %ebp # Null-terminate kernel_main()'s backtrace
#### Call main(). #### Call kernel_main().
call main call kernel_main
# main() shouldn't ever return. If it does, spin. # kernel_main() shouldn't ever return. If it does, spin.
1: jmp 1b 1: jmp 1b
.endfunc .endfunc
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment