mode after bare bones

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: mode after bare bones

Post by Troy Martin »

mov si,answer
call print_string

answer db "Yes.",0Dh,0Ah,0
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
ru2aqare
Member
Member
Posts: 342
Joined: Fri Jul 11, 2008 5:15 am
Location: Hungary

Re: mode after bare bones

Post by ru2aqare »

Troy Martin wrote:
Solar wrote:Just a gut feeling that we, as a community, are getting a bit too aggressive and negative.
/agree=completely
I wouldn't want to take out either the -Werror nor the parameters (as both are helpful), but I wouldn't want to bloat the tutorial with parameter-handling code...
It's possible we could "handle" the parameters in a clean and simple way, using just some kind of "if (param1 == param2);" that should count as usage without doing anything. If I'm wrong, it's because I have asmbrain.
Couldn't you use something like this?

Code: Select all

(void)param1;
(void)param2;
I haven't tried it out though.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Re: mode after bare bones

Post by pcmattman »

If it's GCC you could define an UNUSED macro (__attribute__((unused)) iirc, but it's been a long while) and put that around the main() parameter names.

That might make things too complicated though, it is a BareBones tutorial :P
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: mode after bare bones

Post by Solar »

...and you'd have to go ahead and explain GCC attributes, and why it's not a good idea to rely on them, bloating the tutorial further.

I added a code comment; better yet would be example code that checks the magic number, and prints something from the multiboot data structure to screen - but I'm in a hurry (as always). Might add it later.
Every good solution is obvious once you've found it.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: mode after bare bones

Post by Solar »

Can't really test it ATM, but now it should compile without problems.
Every good solution is obvious once you've found it.
Post Reply