Page 3 of 3

Re: Creating OS [Noobie :D]

Posted: Sat Nov 19, 2011 8:27 am
by CWood
fair enough, disregard my last comments about C...

Re: Creating OS [Noobie :D]

Posted: Sat Nov 19, 2011 8:38 am
by rdos
berkus wrote:edit: and by "abstract" I mean that you don't have access to osdev wiki C tutorials if you cannot understand C, so you have to figure all the basics out by yourself.
Fair enough. I didn't have access to any OS code whatsoever when I wrote my basic kernel, C or ASM, so yes, I did figure out the basics by reading the Intel processor manuals many times, especially the system programming guide.

Re: Creating OS [Noobie :D]

Posted: Sat Nov 19, 2011 8:40 am
by rdos
gerryg400 wrote:So, rdos, you are an asm fan, and prefer asm to C ?

Why didn't you say so before ? :)
I either use asm or C++. C has no place anywhere. It's lousy at low-level stuff, and it doesn't provide any of the OO concepts naturally.

Re: Creating OS [Noobie :D]

Posted: Sat Nov 19, 2011 9:41 am
by neon
rdos wrote:I write directly in asm because asm is superior to C
Right. How is it "superior" again?

Re: Creating OS [Noobie :D]

Posted: Sat Nov 19, 2011 11:44 am
by rdos
neon wrote:
rdos wrote:I write directly in asm because asm is superior to C
Right. How is it "superior" again?
Because it can do anything the processor could do. C can't.

Re: Creating OS [Noobie :D]

Posted: Sat Nov 19, 2011 12:17 pm
by Brynet-Inc
rdos wrote:Because it can do anything the processor could do. C can't.
EDIT: Removed 2015: Imageshack replaced all links with spam.

Re: Creating OS [Noobie :D]

Posted: Sun Nov 20, 2011 3:18 am
by rdos
It's pathetic when people deny that anything that can be done in C/C++/C#/Java cannot also be done directly in asm, while the reverse is not true (an assembler can always do things that C cannot do).

I would at least have expected some arguments that code written for C is more maintainable, or easier to write, less error-prone, more portable, or whatever. But to deny that asm is superior in what can be done is just plain stupid.

Re: Creating OS [Noobie :D]

Posted: Sun Nov 20, 2011 5:30 am
by Chandra
rdos wrote:It's pathetic when people deny that anything that can be done in C/C++/C#/Java cannot also be done directly in asm, while the reverse is not true (an assembler can always do things that C cannot do).

I would at least have expected some arguments that code written for C is more maintainable, or easier to write, less error-prone, more portable, or whatever. But to deny that asm is superior in what can be done is just plain stupid.
I prefer sticking with C as much as possible but you've a valid argument here, everything that can be done in asm cannot be done in C. While C has its advantages over asm, it also a well known truth that every OS developer has at least hundred lines of code written in complete assembly . Asm is not forbiddable.

Re: Creating OS [Noobie :D]

Posted: Sun Nov 20, 2011 6:44 am
by neon
You missed my point. Using assembly language is better then a high level language provided that the appropriate need comes along. If you want to stick with assembly language, go for it. But do not compare it with a high level language by saying its "superior" because its not. The reverse is also true.

Re: Creating OS [Noobie :D]

Posted: Sun Nov 20, 2011 6:59 am
by rdos
neon wrote:You missed my point. Using assembly language is better then a high level language provided that the appropriate need comes along. If you want to stick with assembly language, go for it. But do not compare it with a high level language by saying its "superior" because its not. The reverse is also true.
In my original post, I wrote "asm or C++". When I want the advantages of high-level languages, I also want the advantages of OO programming, which is why I claimed C had no place. OTOH, I do have a C-language module in my OS right now (Intel's ACPICA), but it was only because I don't have time to convert it to C++. When I write my own complex device-drivers in higher-level languages, I'll first create a class-interface with base-classes, so I can use C++. I'll test this for new filesystems first, as these are very hard to code in asm.

Also, the user-mode library that comes with RDOS is a C++ library that encapsulates the OS-functions into a class-interface.

So I'm well aware of the advantages of higher-level languages.

Re: Creating OS [Noobie :D]

Posted: Sun Nov 20, 2011 10:07 am
by guyfawkes
The time you have given to make a basic OS, is plenty of time if you know how to code well in that language.
There's a basic Dos clone, that runs old dos game's etc, that took less than 2 weeks to code.

Re: Creating OS [Noobie :D]

Posted: Sun Nov 20, 2011 12:32 pm
by akatchi
guyfawkes wrote:The time you have given to make a basic OS, is plenty of time if you know how to code well in that language.
There's a basic Dos clone, that runs old dos game's etc, that took less than 2 weeks to code.
Thanks ^^ finally something i understand (i don't know anything about the asm > c discussions :3)
is it hard to code an os like that? well im learning c++ right know :3 and im also making a document about alot of things (this is like 60% of the grade you get for the total thing) when i finished it i gonna struggle with the programming :3

Re: Creating OS [Noobie :D]

Posted: Fri Nov 25, 2011 4:20 am
by adsm
death2all wrote:It is very possible to write entirely in asm. Just be sure to be able to convert from C to asm mentally (not actually that different, given how similar C is to asm...)
Isn't the sane way to convert from C to assembler just to use a C compiler?

Doing the same thing in your head is mental!

(I'm joking, I know what you mean. But it sounded like you were running the compile process in your head, rather than on a CPU. Now that's a cross-compiler...)