I'm not sure why you have this opinion but it is incorrect. In engineering, you learn so that you don't repeat the mistakes of others. Our discipline cannot afford to have people making mistakes that others have made. There's just too much work to be done.Congdm wrote:In my opinion, the main purpose of learning is to correct wrong things.
Is it worth to write my system (small) in Assembly entirely?
Re: Is it worth to write my system (small) in Assembly entir
If a trainstation is where trains stop, what is a workstation ?
Re: Is it worth to write my system (small) in Assembly entir
I think that the portability is not an issue when writing a first small operating system because a vast amount of the C code being non-portable anyway. I am sure that this statement is debatable. Of course, aiming towards the portability is a good thing.Sandras wrote:I say use C, like most do. And they do for a reason. It's portable AND fast.
That is fine and strong assembly skills are helpful in a long run even programming in high level languages. I have even written some machine language and I found it useful.Congdm wrote:But for now, I decided to continue with Assembly. I consider that as a challenge to test my designing and programming skills.
However, I think you should also consider this: if you setup a toolchain to support also C, you could at least say that your choice of using just the assembly has nothing to do with the laziness of setting up the toolchain.
That is true but are we saying that writing an OS entirely in assembly is always a huge mistake? Is that an universal truth?gerryg400 wrote:In engineering, you learn so that you don't repeat the mistakes of others.
It is possible. However, I also do C.http://www.menuetos.net wrote:MenuetOS is an Operating System in development for the PC written entirely in 32/64 bit assembly language.
- Combuster
- 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: Is it worth to write my system (small) in Assembly entir
I say YES.I think this is a pretty good reasoning. I find it very important to keep in your head that nothing is perfect. To answer your "Is it worth to write my system (small) in Assembly entirely?" question:
NO
Because the gain you get is not necessarily the end result being a functioning, maintainable system, but for all the other learning moments you get in the process.
- Love4Boobies
- Member
- Posts: 2111
- Joined: Fri Mar 07, 2008 5:36 pm
- Location: Bucharest, Romania
Re: Is it worth to write my system (small) in Assembly entir
I specifically avoided that phrasing because sometimes you don't even know the wrong strategy yet so there's nothing to correct---however, as you learn more, you will want to know of ways of avoiding it. Also, that was my quote, not Nable's.Congdm wrote:In my opinion, the main purpose of learning is to correct wrong things.
I guess I agree with this view but the original question seemed to put emphasis on the OS (or maybe learning how to write one) rather than the learning of something else. So my revised answer is: It depends on what you want to get out of it.Combuster wrote:I say YES.I think this is a pretty good reasoning. I find it very important to keep in your head that nothing is perfect. To answer your "Is it worth to write my system (small) in Assembly entirely?" question:
NO
Because the gain you get is not necessarily the end result being a functioning, maintainable system, but for all the other learning moments you get in the process.
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
[ Project UDI ]
Re: Is it worth to write my system (small) in Assembly entir
Well, the OP says that he is happier writing assembler than C. So if the intent was to learn more then the answer would definitely be "NO".
Re: Is it worth to write my system (small) in Assembly entir
There could be other design-choices that make it more realistic to write an OS in assembly. Such a design choice might be to exploit x86 segmentation, which is not an option with C-compilers for most of the OS code.
And portability is an overstated "feature". I've seen the drawback of it in lots of "portable code". It's taken me 3-4 weeks to port a unzip utility from Info-Zip that support various OSes and platforms. Given the specifications, it would have been faster to write it from scratch than to port it. The code is so full of strange macros, ifdefs and other junk that it is impossible to follow and understand, even in the presence of a decent debugger. So I would argue that portability and easy-to-read code are impossible to combine. I've not seen any evidence against this yet, and it probably applies just as well to OSes as to "portable" applications.
And, of course, it is possible to code a complex OS-project entirely in assembly. It's been done before.
And portability is an overstated "feature". I've seen the drawback of it in lots of "portable code". It's taken me 3-4 weeks to port a unzip utility from Info-Zip that support various OSes and platforms. Given the specifications, it would have been faster to write it from scratch than to port it. The code is so full of strange macros, ifdefs and other junk that it is impossible to follow and understand, even in the presence of a decent debugger. So I would argue that portability and easy-to-read code are impossible to combine. I've not seen any evidence against this yet, and it probably applies just as well to OSes as to "portable" applications.
And, of course, it is possible to code a complex OS-project entirely in assembly. It's been done before.
Re: Is it worth to write my system (small) in Assembly entir
The question wasn't whether it could be done (obviously it can) but whether it was worth it (debatable). As for segmentation - I know that is a favourite with you but it is a totally outdated technology. Anything that guides people away from using segmentation can only be a good thing.