new in osdev

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
StephanvanSchaik
Member
Member
Posts: 127
Joined: Sat Sep 29, 2007 5:43 pm
Location: Amsterdam, The Netherlands

Post by StephanvanSchaik »

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.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

lukem_95 wrote:yeah, there are some things you CANT do in C++ for osdev.
Name one thing you can do in C that you cannot do in C++. (Aside from bad programming habits.)

Really. I'm interested.
Every good solution is obvious once you've found it.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

Reading his post I think really he's referring to things that you can't do in C/C++, and require ASM for (hence his post about learning asm). That's how I interpret it.
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Post by lukem95 »

yeah James is right, ill be clearer next time :)
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Post by piranha »

You lug around the manuals in school?
Wow.
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++.
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.

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
StephanvanSchaik
Member
Member
Posts: 127
Joined: Sat Sep 29, 2007 5:43 pm
Location: Amsterdam, The Netherlands

Post by StephanvanSchaik »

I only ever read an e-Book of Assembly on my school and I viewed the OSDev wiki and forum a few times on my school but other than nothing else about OSDev like a manual (we may not download anything).


Regards, Stephan J.R. van Schaik.
User avatar
nekros
Member
Member
Posts: 391
Joined: Wed Mar 05, 2008 9:10 pm
Contact:

Post by nekros »

piranha wrote:You lug around the manuals in school?
Wow.
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++.
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.

-JL
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.
Working On:Bootloader, RWFS Image Program
Leviathan: http://leviathanv.googlecode.com
Kernel:Working on Design Doc
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Post by neon »

Solar wrote:
lukem_95 wrote:yeah, there are some things you CANT do in C++ for osdev.
Name one thing you can do in C that you cannot do in C++. (Aside from bad programming habits.)

Really. I'm interested.
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.

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();}
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

StephanVanSchaik wrote:Regards, Stephan J.R. van Schaik.
<g> You may feel yourself lucky not to have been living in the 80s :).


JAL
StephanvanSchaik
Member
Member
Posts: 127
Joined: Sat Sep 29, 2007 5:43 pm
Location: Amsterdam, The Netherlands

Post by StephanvanSchaik »

:lol: 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.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

StephanVanSchaik wrote:If you mean Dallas (the TV show), yeah, my teacher calls me sometimes Mister J.R. Ewing or something.
Indeed, J.R. Ewing, a very nasty dude indeed.

Image


JAL
Post Reply