Advice/Support requested at OS Development

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
ehenkes
Member
Member
Posts: 124
Joined: Mon Mar 23, 2009 3:15 am
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by ehenkes »

I like languages
As a little gag, we use

Code: Select all

times 510-($-$$) hlt
as an alternative to "db 0", because at disassembling that makes sense.
I searched by Google for this version, and found this as the only search result: http://kldp.org/node/89199 (Korean?) :shock:
User avatar
ehenkes
Member
Member
Posts: 124
Joined: Mon Mar 23, 2009 3:15 am
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by ehenkes »

I think you misunderstood what the strcmp call does. It sets the carry flag (stc, jc works for jumping) if the strings are equal and clears it (clc, jnc works for jumping) if the strings are not equal. You appear to have taken out the entire functionality of the kernel's shell.
I hope that I really understood what 'strcmp' does. It looks, whether the command is known and directs the program to the corresponding subroutine. Otherwise the message is "command unknown". To my knowledge it does the same work without Carry Flag. Just go and try it. :D
Fix a few bugs
Could you be more specific, please? :)
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Advice/Support requested at OS Development

Post by Troy Martin »

For example, the strcmp that doesn't compare. I can't think of anything else, though!
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
User avatar
ehenkes
Member
Member
Posts: 124
Joined: Mon Mar 23, 2009 3:15 am
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by ehenkes »

Perhaps you are right. I see your point, but it really performs in checking the instruction just by using the zero flag. If we need more, we will come back to your original code. :)
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Advice/Support requested at OS Development

Post by Troy Martin »

I'm not sure, but I think jz == je as well.
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
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Advice/Support requested at OS Development

Post by Combuster »

equality occurs when the difference is zero, so yes JE corresponds to the same opcode as JZ
"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 ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Advice/Support requested at OS Development

Post by Brendan »

Hi,

The CMP instruction does exactly the same thing as the SUB instruction, except that the result is discarded. The same flags are set for the same reasons. Therefore, for "CMP 0x12, 0x12" the result would be zero and the Z flag is set. In a similar way the TEST instruction does exactly the same thing as the AND instruction, except that the result is discarded.

Intel define synonyms for some instructions (e.g. JE and JZ; JA and JNBE; REP and REPE) so that you can make your code more readable.

Note: NOP was originally a synonym for "XCHG eAX, eAX", and originally these instructions behaved the same. However, for "out-of-order" CPUs these instructions do not behave the same - "XCHG eAX, eAX" should make the CPU wait until previous instructions that modified eAX are completed, and NOP shouldn't. For most (all?) "out-of-order" CPUs, NOP has become an instruction (rather than a synonym) and "XCHG eAX, eAX" doesn't really exist.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Advice/Support requested at OS Development

Post by Creature »

Kevin wrote:Well, so there are already enough tutorials in English, no? ;)

Hm, Belgium... I've never seen a tutorial in Dutch or French - probably I wouldn't understand too much of the latter, but I might have chances with the former. I like languages, and that doesn't only include English. :)
Haven't seen any OSDev tuts in Dutch either, I've seen them in French though. Besides, Belgium has 3 national languages: Dutch, French and German. All of them are tought in school including English :P.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Advice/Support requested at OS Development

Post by Combuster »

Creature wrote:Haven't seen any OSDev tuts in Dutch either
Dutchies are too good at English. :mrgreen:
"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 ]
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: Advice/Support requested at OS Development

Post by jal »

Combuster wrote:
Creature wrote:Haven't seen any OSDev tuts in Dutch either
Dutchies are too good at English.
Not to mention that everything written in Dutch that concerns computers somehow looks to be aimed at digibeten and dummy's. I've seen things like 'cache' and 'CPU' (CVE anyone?) translated - it's ugly.


JAL
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by Kevin »

Creature wrote:Besides, Belgium has 3 national languages: Dutch, French and German. All of them are tought in school including English :P.
I'm aware of that (well, I didn't know that German is tought everywhere in Belgium), but as one of the Lowlevel admins (German OS-Dev community) I've obviously seen lots of German tutorials. ;)
jal wrote:Not to mention that everything written in Dutch that concerns computers somehow looks to be aimed at digibeten and dummy's. I've seen things like 'cache' and 'CPU' (CVE anyone?) translated - it's ugly.
I guess you call it ugly because you're not used to it. English words aren't any better per se.

By the way, in German I have experienced it the other way round: "Dummies" as you call them tend to say "Computer" whereas the more experienced more often use the German "Rechner".
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by Solar »

Simply because it's one syllable less, and techies tend to be lazy as hell. :-D
Every good solution is obvious once you've found it.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by Kevin »

Hm, never thought about it that way... Might be true. But then, I also say "Festplatte"and not "hard disk", even though it's one syllable more. In the end, I don't think it's much more than a nice theory. ;)
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by Solar »

Roll around those words in your mouth and you'll realize that, the way you speak it, "Festplatte" also has only two syllables, and is easier to pronounce. (Don't tell me you actually pronounce the "-te" as individual syllable.)

Add to that how we techies have grown to hate those sales drones and management goons that have to use English vocabulary for everything... :twisted:
Every good solution is obvious once you've found it.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Advice/Support requested at OS Development

Post by Kevin »

The final schwa in "Festplatte" might be unstressed, but it still makes a third syllable.

I wholeheartedly agree about hating the Schlipsträger language, though. This is the much better theory. ;)
Developer of tyndur - community OS of Lowlevel (German)
Post Reply