Re:IRQ Problems
Posted: Thu Oct 27, 2005 3:43 pm
Oh well, they should know ASM while OSDeving
Sure, you need asm for some specific things, but my point was that no one wants to read through reams and reams of pages of assembler for the entire OS. C is a lot easier on the eyes (and brain).Nelson wrote: Oh well, they should know ASM while OSDeving
Not always. Remember: "All the elegance and power of assembly language with all the readability and maintainability of assembly language." Now, of course, I happen to think that no language can make code readable if the author doesn't intend it to be, but C is still somewhat messy.Colonel Kernel wrote:Sure, you need asm for some specific things, but my point was that no one wants to read through reams and reams of pages of assembler for the entire OS. C is a lot easier on the eyes (and brain).Nelson wrote: Oh well, they should know ASM while OSDeving
That would be the idea - psuedo code in Parts I and II with real code in Part III. The code in part III would be carefully selected to illustrate the content of the book - the guts of the single-CPU scheduler without any of the SMP/NUMA/hyper-threading detection code (for that they can see the full source on the CD).Nelson wrote:Perhaps provide psuedo code with an ASM example?
Nelson wrote: PASCAL is hard to read (:P)
Someone should write a tutorial which forwards people to either the Wiki or the Intel Docs.
No language can make code readable if the author doesn't intend it to be.
OK, "well-written" C. Well-written assembler takes a lot longer for the human eye and the human mind to process than well-written C (or Pascal, or C++, or OCaml -- whichever).Remember: "All the elegance and power of assembly language with all the readability and maintainability of assembly language."
I'm not disputing that. I meant literally what I said -- not that many people are interested in reading through pages and pages of assembly, especially if they have to pay money to buy the book that explains it all in the first place. The Minix 2.0 source was bad enough IMO, but at least with Minix the C code acted as both the "pseudo-code" and the "real" code. Anything else is a duplication of effort (remember, we're talking about publishing a book here).Brendan wrote: @Colonel Kernel
IMHO being able to read assembly (and understanding how the CPU works) makes OS development much easier.
I think at that point you're crossing the line between teaching people concepts and just doing their work for them. If you intend to make your OS a commercial venture, you'd just be handing your competitors a big chunk of your advantage.For example, rather than using the CPUID instruction directly and hoping things work it'd have about 40 pages of CPU detection code which takes into account most manufacturer's features and errata, with several paragraphs explaining why using CPUID directly must be avoided for stable code.
The idea would be to present something that shows people how to write code that works on all computers, rather than something simple that only works when you're lucky.
No - I'm a little more devious than that!Colonel Kernel wrote:I think at that point you're crossing the line between teaching people concepts and just doing their work for them. If you intend to make your OS a commercial venture, you'd just be handing your competitors a big chunk of your advantage.The idea would be to present something that shows people how to write code that works on all computers, rather than something simple that only works when you're lucky.
The CPUID instruction itself is simple enough. The problem is tracking down all the errata for the CPUs and working out which manufacturers use which flags for their own proprietory extensions.Nelson wrote:On the topic of the CPUID, this isn't information which is new (afaik) so it can be obtained with a little research and implementation. I don't think they gain any significant advantage.
I'm serious about writing my source code with full explanations, etc, so that it could be used for Part III without much change, and if I knew I could get a book published I'd start working on Part I and Part II now.Nelson wrote:Are you serious in writing this? I thought it was just a thought you had.
You could publish it with a print on demand service like lulu. I think that its free to get it sold on their site, or about US$125 to get a ISBN so you can order it from bookstores or on Amazon.com.I'm serious about writing my source code with full explanations, etc, so that it could be used for Part III without much change, and if I knew I could get a book published I'd start working on Part I and Part II now.