How do I start? For real.

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.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: How do I start? For real.

Post by iansjack »

thehardcoreOS wrote:Why are there so many linux related stuff (wiki page)? 90% of the world population uses windows as their default os.
To be fair, 90% of the world population don't do OS design. You don't have to use Linux; stick with Windows if you like. But don't complain that other people use Linux for this sort of work and so, naturally, aim any documentation that way.
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: How do I start? For real.

Post by Kazinsal »

OS development on Windows without a Linux VM is incredibly painful. You will experience physical pain if you attempt it. Mostly in the frontal lobe.

I say this as someone who thinks GNU/Linux will never become a mainstream supported desktop operating system: Linux is *the* platform for OS dev because of how you can just basically slam a compiler in, use that compiler to build a new compiler, and then use that compiler to build an operating system kernel.
embryo2
Member
Member
Posts: 397
Joined: Wed Jun 03, 2015 5:03 am

Re: How do I start? For real.

Post by embryo2 »

Kazinsal wrote:Linux is *the* platform for OS dev because of how you can just basically slam a compiler in, use that compiler to build a new compiler, and then use that compiler to build an operating system kernel.
Do you mean there is no Windows based compiler that is able to produce your kernel code? Or should I think that you just don't understand the result of you compilation?

Windows is perfectly suitable for the OSdeving, but yes, if you plan to build another Linux, then Windows is a bit inconvenient.
My previous account (embryo) was accidentally deleted, so I have no chance but to use something new. But may be it was a good lesson about software reliability :)
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: How do I start? For real.

Post by Roman »

Linux is *the* platform for OS dev because of how you can just basically slam a compiler in, use that compiler to build a new compiler, and then use that compiler to build an operating system kernel.
Why do you think it's impossible or difficult to use Windows, OS X, QNX or whatever's advanced enough to build a new compiler and a kernel?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
AMenard
Member
Member
Posts: 67
Joined: Mon Aug 25, 2014 1:27 pm

Re: How do I start? For real.

Post by AMenard »

Roman wrote:
Linux is *the* platform for OS dev because of how you can just basically slam a compiler in, use that compiler to build a new compiler, and then use that compiler to build an operating system kernel.
Why do you think it's impossible or difficult to use Windows, OS X, QNX or whatever's advanced enough to build a new compiler and a kernel?
Probably because no one as ever taken the time to write a nice wiki page about it that I know of. :mrgreen:
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: How do I start? For real.

Post by Roman »

AMenard wrote:
Roman wrote:
Linux is *the* platform for OS dev because of how you can just basically slam a compiler in, use that compiler to build a new compiler, and then use that compiler to build an operating system kernel.
Why do you think it's impossible or difficult to use Windows, OS X, QNX or whatever's advanced enough to build a new compiler and a kernel?
Probably because no one as ever taken the time to write a nice wiki page about it that I know of. :mrgreen:
What do you mean? There's information about developing under Windows (with Visual Studio), OS X on the wiki.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: How do I start? For real.

Post by Kazinsal »

Configuring Visual Studio to produce suitable kernel code is a pain and if you want to use ELF, you need to install mingw or something else that has a working objcopy binary, because VS will only output PE/COFF (and getting it to spit out a kernel-grade binary with minimal windows cruft can also be a pain.)

Getting Cygwin to behave is even worse. And then you're left with a crap terminal by posix standards because no one bothered to write/port a proper terminal emulator for cygwin. MinGW tends to work better out of the box for compiling stuff but building a cross-compiler can be painful.

Windows has no real good built-in way to sector-level manipulate disk images. You also can't do any GRUB related stuff on Windows, such as grub-mkrescue to create an ISO of your operating system.

I use Windows for pretty much everything and I often disapprove of people trying to push Linux as a general-purpose desktop operating system (because of various factors, such as configuration often still requiring arcane config files and the fact that no distros seem to get along or be truly compatible between each other, which will just confuse non-power users). However, in the case of operating system development, Windows is not worth using. Fire up VirtualBox, create a VM with a gig of RAM, close your four dozen Firefox tabs to free up some memory, install a nice, lightweight Linux distro, and build a cross-compiler.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: How do I start? For real.

Post by neon »

In other words, you have no idea.

Configuring VS can be done through the command line via makefiles in the same way GCC does. And you don't need Cygwin or any *nix utilities -- and many really good disk imaging utilities exist for Windows as well as disk editors that allow sector reading and writing. And many of us written our own C boot loaders - don't need GrUB.

I don't quite think you really looked into it. The only thing brought up that is correct is that VS only supports COFF/PE which may or may not be desired.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: How do I start? For real.

Post by Kazinsal »

An entire command-line configuration seems to defeat the purpose of Visual Studio. Not to mention that every version, they wildly change the way various options are configured, so what works on some archaic compiler like Visual C++ 2003 won't work on 2010, or 2012, or whatever the newest one is. Sufficiently complex user-mode programs won't even convert properly to a newer version because of the changes.

Are those disk editing programs all graphical? Because that sounds like a huge waste of time when you're trying to rapidly develop and test a kernel. And now that you're combining command-line hacks with graphical programs like HxD and WinImage, you're not even sticking to the Visual Studio "everything within one IDE" philosophy.

I have worked with Visual Studio for several versions now. Every version, I look at it and think, "wow, this would be great if I was still writing .NET or terrible DirectX hooks", then go back to my pleasant little GCC/binutils/coreutils setup where it just plain works out of the box. All the time I spent configuring it, I hit Enter on a script and went for coffee with a friend.

It's just not a good platform for operating system development.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: How do I start? For real.

Post by neon »

If you want to use the IDE, then use the IDE. Yeesh. Nothing prevents it. And VS auto-upgrade of project files very rarely cause issues. I concede quickly that some issues do sometimes come up -- but only with one or two additional switches over the past decade. I can claim this as fact given that we use VS as one of our supported tool chains in our build system.

I prefer graphical disk editing programs -- but if you don't, there are many console based programs as well. Don't know why you would prefer to downgrade though. Have you even attempted to look? Rapidly developing and testing is very simple -- and can be automated.

Don't get me wrong - I concede quickly that development using GCC has more positives -- but to claim that development in VS is very difficult when its not is ignorance. And given that you have been given multiple links that demonstrate this is willful ignorance.
Last edited by neon on Mon Aug 10, 2015 4:07 pm, edited 1 time in total.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: How do I start? For real.

Post by Kazinsal »

The IDE is fine for Windows programs. Most of the time. I was involved in twice converting an entire suite of server administration and plugin software to a newer version of Visual Studio, from 2003 to 2008 and from 2008 to 2010. Each "upgrade" necessitated completely rebuilding half the configuration of each solution and project.

Being able to actually script something into a single build step is not a downgrade. Being unable to is. Having to find a way to throw several lines of post build step code into a single text box is not fun, let me tell you.

I didn't *want* to use PE/COFF. Visual Studio was adamant about making it really hard for me to use anything other than it.

That's not a good software suite for operating system development at all.

e: The one link in this entire thread relevant to setting up Visual Studio in any way shape or form is a link to your own tutorials on setting up the configuration specifics of a ten year old version of Visual C++ that you can't even download anymore as far as I'm aware. Thanks for enlightening me. :roll:
Last edited by Kazinsal on Mon Aug 10, 2015 4:09 pm, edited 1 time in total.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: How do I start? For real.

Post by neon »

I give up -- you are willfully ignorant and do not care.

Please do not criticize my articles -- they are very different then our internal project which automates and uses its own build system. The articles are designed differently for a reason. You are just displaying more willful ignorance. It is also an ad-hoc attack rather then a rational on your argument and that is pure dishonesty. And you have been given a reference to the Wiki which provides other methods of using VS.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: How do I start? For real.

Post by Kazinsal »

You use a different build system yet claim Visual Studio's own build system is a competent solution? Good lord.

And perhaps actually give links instead of just saying they're there? I'm not going to search through eleven years of this forum's history looking for people with actual working examples of Visual Studio being used for development.

Willful ignorance indeed.
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: How do I start? For real.

Post by neon »

Our build system is a set of makefiles that calls the toolchain. Stop with your damned assumptions.

Learn how to use Google and find them yourself - and stop being willfully ignorant. If you stop making the poor assumptions and blanket lies and ad hoc attacks, I would be more then happy to describe our build process as an example working system as well as provide some links. But if you continue, then the discussion is over.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Kazinsal
Member
Member
Posts: 559
Joined: Wed Jul 13, 2011 7:38 pm
Libera.chat IRC: Kazinsal
Location: Vancouver
Contact:

Re: How do I start? For real.

Post by Kazinsal »

"Learn how to use Google" is no more than a cop-out. I'm sorry you couldn't change my mind, but that's no excuse to insult me and then edit your post three (or four, I've lost track while writing and rewriting this post) times.

I am not willfully ignorant. I have yet to have evidence given to me that changes my viewpoint on Visual Studio being an absolutely terrible platform for operating system development, and Windows being a terrible platform for operating system development except as a hypervisor for a Linux virtual machine. The Visual Studio page on the wiki (look it up yourself) recommends several times within the first screenful of information several hacks involving mingw and/or cygwin tools to get around limitations in the development software, admits the information is only truly valid for Visual C++ 2003, and then points the user to a ten years newer version of the software, where the entire set of configuration options has changed.

I'm glad Visual Studio's toolchain works for you. I will continue to recommend newcomers to the forums and IRC to use a GCC cross-compiler because there is an overwhelming majority of people who it will simply work much better for. I am positive the rest of the forum regulars will do exactly the same thing.
Post Reply