OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 8:35 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 13 posts ] 
Author Message
 Post subject: Do I need C?
PostPosted: Wed Jan 11, 2017 11:00 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 03, 2016 3:13 am
Posts: 64
Besides Assembly, do I really need C in OSdev?

Can I just learn a different language for writing my code in?

I know you probably need to be able to read in C, but is there any other options, especially for a novice? I want to learn some new language I never touched before.


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Wed Jan 11, 2017 11:26 pm 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
The wiki's Languages page covers this subject in a reasonable amount of detail, actually. The general answer is, you will need to be able to read C to use most of the available learning resources, but for writing your own OS you should be able to use any language which meets the requirements laid out on that page (or rather, any language for which there is an implementation which meets them; this stipulation loosens those rules a bit, as it means that a subset or otherwise specialized compiler might be able usable where the standard versions would not be).

Mind you, there are others such as myself who take it even further and design their own language from the ground up specifically for their OS; see the Alta Lang archetype page, and maybe the CompilerDev site, for further information on this approach.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Wed Jan 11, 2017 11:27 pm 
Offline
Member
Member
User avatar

Joined: Fri Mar 07, 2008 5:36 pm
Posts: 2111
Location: Bucharest, Romania
No. You just need to figure out what your goals are and which language would be more suitable to achieve those goals. To give a couple of examples:

  • If I wanted to target a wide range of embedded platforms, I'd probably use C because it's the least terrible option. For all its misgivings, you can expect C to be available almost universally because good compilers for it are dirt cheap to implement.
  • If I wanted a highly reliable system, I would probably go for a functional language.
  • If I wanted a managed system, I would probably pick a safe language (Java and C# are the more popular options but there are alternatives).
  • If I wanted the system to to port existing software, I'd pick something that did not interfere with those goals.
  • If I had certain goals that are not reasonably met by existing languages, I would design my own.

_________________
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Thu Jan 12, 2017 12:44 am 
Offline
Member
Member
User avatar

Joined: Tue Jan 10, 2017 3:19 pm
Posts: 84
You don't. However, i recommend using C or other language that's not Assembly.

Assembly can be very hard, while C has a easier syntax, along with many more functions.

_________________
(not so frequently updated) Code is at:

https://github.com/NunoLava1998/DixiumOS-1


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Thu Jan 12, 2017 3:30 am 
Offline
Member
Member
User avatar

Joined: Fri Mar 07, 2008 5:36 pm
Posts: 2111
Location: Bucharest, Romania
No, assembly is actually a much simpler language than C is as far as both syntax and semantics are concerned. Similarly, C is simpler than C++ or Java are. The point is that designers will sometimes move the complexities of software inside the language so that the development process becomes simpler (i.e., you have a complex language that does complex things on your behalf).

To make an analogy, think of a printing press. You could write a book by hand. In principle, that process is quite simple, just like assembly language. In practice, it's much faster to use a complex piece of machinery (the equivalent of what we vaguely call "higher-level" languages) that will produce the book for you. The resulting book will come out faster, is almost guaranteed to have less errors. As an added bonus, you can use the same printing press for many other books as well.

_________________
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 6:36 am 
Offline
Member
Member

Joined: Wed Jan 11, 2017 3:29 pm
Posts: 27
Nope, you don't need C.

Assembly is very good. It is more faster and lightweight. However, it won't support many architectures. There are many operating systems 100% fully written in Assembly like KolbriOS and MenuetOS.

If you are beginning Assembly, I suggest you learn MS-DOS debug assembly first from YouTube. There are also many references on Wikipedia. Search assembly fun or assembly tutorial kupala. This is how I learn.

Learn Intel syntax so it can run on i386 and x86 blah blah blah. It's quite popular. Use Intel's syntax.


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 7:43 am 
Offline
Member
Member
User avatar

Joined: Thu Jul 12, 2012 7:29 am
Posts: 723
Location: Tallinn, Estonia
I hope I don't hit this forum's internal limit on ignore list, it's filling up so fast.

_________________
Learn to read.


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 8:45 am 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
Hi,


TheDev100 wrote:
Assembly is very good. It is more faster and lightweight. However, it won't support many architectures.
Each architecture has its own assembly language. So, while it's true to say "A specific assembly language supports only one architecture", it's totally wrong to say "Assembly language supports only one architecture".

TheDev100 wrote:
There are many operating systems 100% fully written in Assembly like KolbriOS and MenuetOS.
I must admit KolibriOS is impressive as an operating system, however it's hard for a team to write maintainable assembly code while keeping it optimised too.

TheDev100 wrote:
If you are beginning Assembly, I suggest you learn MS-DOS debug assembly first from YouTube. There are also many references on Wikipedia. Search assembly fun or assembly tutorial kupala. This is how I learn.
Bad advice. MS-DOS assembly is by 25 years oudated (let's be optimist!) and it doesn't really teach you anything useful nowadays (even if you are writing a bootloader for BIOS, you can't use interrupt 0x21 that is present in most of assembly code for MS-DOS, so it's useless).

TheDev100 wrote:
Learn Intel syntax so it can run on i386 and x86 blah blah blah. It's quite popular. Use Intel's syntax.
This is debatable. While I agree with you, you will find so much opposition from other people that we rather don't discuss it here.


Regards,
glauxosdever


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 12:35 pm 
Offline
Member
Member
User avatar

Joined: Wed Aug 31, 2016 9:53 pm
Posts: 81
Location: San Diego, CA
dozniak wrote:
I hope I don't hit this forum's internal limit on ignore list, it's filling up so fast.


It's like going to the gym in January. You have all these new year's resolutioners coming in and doing exercises that are made up/should never be done and just taking up space and equipment. Luckily, the ones that weren't serious end up giving up after a month and everything goes back to normal. The ones who are serious ask questions, watch, and make an effort. And they're welcomed with open arms.

Lets hope we can say the same here.

_________________
Some of my open-source projects:
Ext2/ELF32 bootloader
Lightweight x86 assembler, designed to be portable for osdev
Scheme in under 1000 lines of C


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 2:21 pm 
Offline
Member
Member
User avatar

Joined: Sat Dec 03, 2016 3:13 am
Posts: 64
Quote:
Bad advice. MS-DOS assembly is by 25 years oudated (let's be optimist!) and it doesn't really teach you anything useful nowadays (even if you are writing a bootloader for BIOS, you can't use interrupt 0x21 that is present in most of assembly code for MS-DOS, so it's useless).


Would you recommend something else? Why should it matter? There is still DOS emulators people use everyday.


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 2:24 pm 
Offline
Member
Member

Joined: Wed Jun 17, 2015 9:40 am
Posts: 501
Location: Athens, Greece
Hi,


Mark12 wrote:
Quote:
Bad advice. MS-DOS assembly is by 25 years oudated (let's be optimist!) and it doesn't really teach you anything useful nowadays (even if you are writing a bootloader for BIOS, you can't use interrupt 0x21 that is present in most of assembly code for MS-DOS, so it's useless).
Would you recommend something else? Why should it matter? There is still DOS emulators people use everyday.
I didn't know I'm running my software on top of a DOS emulator...

Seriously now, do you think that learning a 35-years old technology that got obsolete 25-years ago is going to do any good to the learner?


Regards,
glauxosdever


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 2:25 pm 
Offline
Member
Member
User avatar

Joined: Tue Aug 02, 2016 1:52 pm
Posts: 286
Location: East Riding of Yorkshire, UK
Mark12 wrote:
Why should it matter?
His point was that MS-DOS is old cruft and can't really be applied to anything modern.

_________________
com.sun.java.swing.plaf.nimbus.InternalFrameInternalFrameTitlePaneInternalFrameTitlePaneMaximizeButtonWindowNotFocusedState
Compiler Development Forum


Top
 Profile  
 
 Post subject: Re: Do I need C?
PostPosted: Fri Jan 13, 2017 3:36 pm 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
Mark12 wrote:
Would you recommend something else? Why should it matter? There is still DOS emulators people use everyday.

DOS runs in Real Mode. If you want to learn how to program assembly in Real Mode, it can be a useful start. However, you can't write a modern OS (or any modern software) with that.

_________________
Developer of tyndur - community OS of Lowlevel (German)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: iansjack, Majestic-12 [Bot], nullplan and 228 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group