OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 8:22 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Wiki: C++ Barebones [Mistake]
PostPosted: Sat Jan 10, 2009 7:51 am 
Offline
User avatar

Joined: Fri Jan 09, 2009 8:47 am
Posts: 16
Location: Belluno, Italy
Hello guys,
while reading the wiki regarding the C++ Barebone Kernel I found an error into the code in section "main.cpp". multiboot_data, in fact it's not declared and so the code won't compile. The code should be like this:

Code:
extern "C" void _main(void* mbd, unsigned int magic);

void _main( [b]void*[/b] mbd, unsigned int magic )
{
   // write your kernel here
}


Unless you define multiboot_data with a typedef obvoiusly

_________________
http://www.gravity0.co.nr

i686-elf Toolchain


Top
 Profile  
 
 Post subject: Re: Wiki: C++ Barebones [Mistake]
PostPosted: Sat Jan 10, 2009 1:06 pm 
Offline
Member
Member
User avatar

Joined: Fri Apr 18, 2008 4:40 pm
Posts: 1686
Location: Langley, Vancouver, BC, Canada
Done!

_________________
Image
Image
Solar wrote:
It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.

I wish I could add more tex


Top
 Profile  
 
 Post subject: Re: Wiki: C++ Barebones [Mistake]
PostPosted: Sat Jan 10, 2009 2:33 pm 
Offline
User avatar

Joined: Fri Jan 09, 2009 8:47 am
Posts: 16
Location: Belluno, Italy
Troy Martin wrote:
Done!

thanks! Hope I have been helpful.

_________________
http://www.gravity0.co.nr

i686-elf Toolchain


Top
 Profile  
 
 Post subject: Re: Wiki: C++ Barebones [Mistake]
PostPosted: Sun Jan 11, 2009 6:12 pm 
Offline
Member
Member
User avatar

Joined: Tue Jul 10, 2007 5:27 am
Posts: 2935
Location: York, United Kingdom
I'd prefer that to be written as:

Code:
int main(struct multiboot_data *mbd, unsigned int magic)


This should compile with only a warning (because of the "struct") - as long as mbd isn't dereferenced - and it gives a visual hint to the reader that there's something special about that parameter - it's a struct, not some arbitrary point in memory.

Wiki updated. Roll back if required ;)

_________________
Horizon - a framework and language for SAS-OS development
Project 'Pedigree'
Practical x86 OSDev tutorials


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 83 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group