Creating OS [Noobie :D]
Re: Creating OS [Noobie :D]
fair enough, disregard my last comments about C...
Re: Creating OS [Noobie :D]
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.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.
Re: Creating OS [Noobie :D]
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.gerryg400 wrote:So, rdos, you are an asm fan, and prefer asm to C ?
Why didn't you say so before ?
Re: Creating OS [Noobie :D]
Right. How is it "superior" again?rdos wrote:I write directly in asm because asm is superior to C
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: Creating OS [Noobie :D]
Because it can do anything the processor could do. C can't.neon wrote:Right. How is it "superior" again?rdos wrote:I write directly in asm because asm is superior to C
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
Re: Creating OS [Noobie :D]
EDIT: Removed 2015: Imageshack replaced all links with spam.rdos wrote:Because it can do anything the processor could do. C can't.
Last edited by Brynet-Inc on Fri Aug 28, 2015 8:56 pm, edited 1 time in total.
Re: Creating OS [Noobie :D]
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 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]
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.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.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: Creating OS [Noobie :D]
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.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: Creating OS [Noobie :D]
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.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.
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]
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.
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]
Thanks ^^ finally something i understand (i don't know anything about the asm > c discussions :3)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.
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]
Isn't the sane way to convert from C to assembler just to use a C compiler?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...)
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...)