OSDev.org

The Place to Start for Operating System Developers
It is currently Sun Dec 04, 2022 3:30 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: An additional suggestion for the 'Brans known bugs' page
PostPosted: Sun Nov 02, 2008 9:46 pm 
Offline

Joined: Sun Nov 02, 2008 9:27 pm
Posts: 11
Hi,

Came across this (very cool) site after spending the last couple of days covering the basics, mainly using Bran's Kernel Development tutorial. I'm sure glad he took the time to write that! Anyway, one problem I had run into was my Grub loader not recognising the file format of my kernel binary when introducing strings into my main.c. I saw the note in the page http://wiki.osdev.org/Bran%27s_Known_Bugs regarding the .rodata section in the linker file, but in my case this appeared not to work (still getting a 1Mb+ sized binary and grub not recognising the format of the file). Examining the kernel binary using hexdump, I saw that the strings were still getting placed at location 0 rather than where they should be.

The fix is simple, and probably obvious to those in the know, but it took me a little while to solve it. Bran specifies the 'aout' format in the nasm command in his build.bat. By changing the output format of nasm from 'aout' to 'elf', as well as adding the .rodata line in the link.ld file everything works just fine.

Sorry if this has been done to death in the past, but not seeing anything on the 'known bugs' page I thought I'd mention it!

Eddy.


Top
 Profile  
 
 Post subject: Re: An additional suggestion for the 'Brans known bugs' page
PostPosted: Sun Nov 02, 2008 10:17 pm 
Offline
Member
Member
User avatar

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

Welcome to the OSDev forums! I've added your suggestion to the wiki.

BTW, you can use this as a way to link to the wiki:
Code:
[wiki]Page Name Here[/wiki]


~~Troy

_________________
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: An additional suggestion for the 'Brans known bugs' page
PostPosted: Sun Nov 02, 2008 10:38 pm 
Offline

Joined: Sun Nov 02, 2008 9:27 pm
Posts: 11
Thank you! ... and wiki link method duly noted.

Eddy


Top
 Profile  
 
 Post subject: Re: An additional suggestion for the 'Brans known bugs' page
PostPosted: Mon Nov 03, 2008 8:42 am 
Offline

Joined: Sun Oct 19, 2008 3:57 am
Posts: 12
There are other errors in Bran's tutorial, here are some i know:
in the file scrn.c , the function settextcolor() has a ligne that misses a ';'
in the same file #include<system.h> is written with extra spaces: < system.h > (doesn't work like that).
in main.c the size_t type is not recognised!
... and i am still debugging as i go.
I think i should publish a corrected version of the sources when i fininish, as Bran doesn't seem to be interested in this **** anymore.
PS: what i don't understand is how can so many people claim that much of a success about such a bogueus code?! how do you guys do?

Edit: i found out! you should not use the main.c that was provided as a "solution" this one has like a dozen compile errors xD, use the one where you should fill you own stuff inside instead, the one that was in the page (not the link), ... i am still implementing the missing functions heheh.


Top
 Profile  
 
 Post subject: Re: An additional suggestion for the 'Brans known bugs' page
PostPosted: Mon Nov 03, 2008 9:29 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
You're always going to get whitespace errors when copying from HTML pages. Better indeed to use the source archive.

Even better to use a more recent and maintained tutorial, like JamesM's series

_________________
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]


Top
 Profile  
 
 Post subject: Re: An additional suggestion for the 'Brans known bugs' page
PostPosted: Mon Nov 03, 2008 9:53 am 
Offline

Joined: Sun Nov 02, 2008 9:27 pm
Posts: 11
Well I found a few pointer related issues, and some inconsistency in the use of const etc. Also, the tutorial assumes (indeed makes a point of stating) that the gcc output will contain leading underscores on externally visible functions (ie: in the ASM file you call _main rather than main) which is an old BSD standard. You can get around this by either using -fleading-underscore as an additional arg to gcc (which I wouldn't recommend) or you can just avoid using leading underscores altogether.

Basically I figured that all that stuff was not important. The tutorial is enough to get you started but if you have any difficulty resolving a few compiler warnings and basic language issues then you probably aren't ready to start writing your own kernel ;-)

Eddy


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 2 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