new in osdev
-
- Member
- Posts: 127
- Joined: Sat Sep 29, 2007 5:43 pm
- Location: Amsterdam, The Netherlands
Piranha,
It doesn't matter if you know C or C++. If you know one of those then you will easily understand the other one. So you don't need to learn C to understand the examples if you know C++.
You should learn Assembly for OS Dev though since some examples are in Assembly and because some parts can only be done in Assembly.
The Art Of Assembly e-Book
If you are going to use NASM or something else instead of something like FASM then read the manual and the e-Book, some things will be different.
Example: in FASM they use "array db 32 dup (?)" as showed in the e-Book to create an array of 32 elements where the elements are undefined. In NASM they will most likely use "array resb 32" as showed in the NASM manual.
Regards, Stephan J.R. van Schaik.
It doesn't matter if you know C or C++. If you know one of those then you will easily understand the other one. So you don't need to learn C to understand the examples if you know C++.
You should learn Assembly for OS Dev though since some examples are in Assembly and because some parts can only be done in Assembly.
The Art Of Assembly e-Book
If you are going to use NASM or something else instead of something like FASM then read the manual and the e-Book, some things will be different.
Example: in FASM they use "array db 32 dup (?)" as showed in the e-Book to create an array of 32 elements where the elements are undefined. In NASM they will most likely use "array resb 32" as showed in the NASM manual.
Regards, Stephan J.R. van Schaik.
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
You lug around the manuals in school?
Wow.
-JL
Wow.
I understand that.....Just if you don't know C++ then I think it's better to start in C than to learn C++ and start then. I also look at kernel code of both languages and find that C++ is generally more confusing at this level.Piranha,
It doesn't matter if you know C or C++. If you know one of those then you will easily understand the other one. So you don't need to learn C to understand the examples if you know C++.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Member
- Posts: 127
- Joined: Sat Sep 29, 2007 5:43 pm
- Location: Amsterdam, The Netherlands
Something to do at school, my math teacher barely speaks english, her native tongue is from India, but it is a language that is not widely spread.piranha wrote:You lug around the manuals in school?
Wow.
I understand that.....Just if you don't know C++ then I think it's better to start in C than to learn C++ and start then. I also look at kernel code of both languages and find that C++ is generally more confusing at this level.Piranha,
It doesn't matter if you know C or C++. If you know one of those then you will easily understand the other one. So you don't need to learn C to understand the examples if you know C++.
-JL
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
There actually *are* some constructs that are allowed in C, but not C++. While most of C will work fine compiled as C++, C++ adds some extra rules that make some C code generate errors. ...This is in relation to the languages themselves, not OS development, though, so it may not be what you are referring to here.Solar wrote:Name one thing you can do in C that you cannot do in C++. (Aside from bad programming habits.)lukem_95 wrote:yeah, there are some things you CANT do in C++ for osdev.
Really. I'm interested.
This is one of the reasons why I consider C and C++ different languages, rather then "C++ being a superset of C".
Clicky - C and C++ compatibility
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();}
-
- Member
- Posts: 127
- Joined: Sat Sep 29, 2007 5:43 pm
- Location: Amsterdam, The Netherlands
If you mean Dallas (the TV show), yeah, my teacher calls me sometimes Mister J.R. Ewing or something. I don't really remember how he calls me. But I do not really care about it since I actually don't know that show. It's before my time . I just like to write down my full name. I never knew about Dallas until my teacher physics came with it.
Regards, Stephan J.R. van Schaik.
Regards, Stephan J.R. van Schaik.
Indeed, J.R. Ewing, a very nasty dude indeed.StephanVanSchaik wrote:If you mean Dallas (the TV show), yeah, my teacher calls me sometimes Mister J.R. Ewing or something.
JAL