Change the way sections are set

This commit is contained in:
Baptiste Wicht 2013-12-15 20:08:12 +01:00
parent 1433bcd51c
commit 8fca1bc2a0
4 changed files with 12 additions and 4 deletions

View File

@ -8,6 +8,10 @@
#ifndef BOOT_32_HPP #ifndef BOOT_32_HPP
#define BOOT_32_HPP #define BOOT_32_HPP
void __attribute((section("boot_32_section"), noreturn)) pm_main(); extern "C" {
void __attribute((noreturn)) pm_main();
} //end of exern "C"
#endif #endif

View File

@ -7,12 +7,12 @@ SECTIONS
.text_16 BLOCK(512) : ALIGN(512) .text_16 BLOCK(512) : ALIGN(512)
{ {
*(boot_16) boot_16_64.o(.text)
} }
.text_32 BLOCK(512) : ALIGN(512) .text_32 BLOCK(512) : ALIGN(512)
{ {
*(boot_32) boot_32_64.o(.text)
} }
/* 4K of code */ /* 4K of code */

View File

@ -107,7 +107,7 @@ void __attribute__((noreturn)) pm_jump(){
} //end of anonymous namespace } //end of anonymous namespace
void __attribute__ ((section("boot_16_section"), noreturn)) rm_main(){ void __attribute__ ((noreturn)) rm_main(){
//Make sure segments are clean //Make sure segments are clean
reset_segments(); reset_segments();

View File

@ -103,6 +103,8 @@ void __attribute__((noreturn)) lm_jump(){
} //end of anonymous namespace } //end of anonymous namespace
extern "C" {
void pm_main(){ void pm_main(){
//Update segments //Update segments
set_segments(); set_segments();
@ -125,3 +127,5 @@ void pm_main(){
//long mode jump //long mode jump
lm_jump(); lm_jump();
} }
} //end of exern "C"