Page 2 of 2

Re: Coding General Bootloader & Make File for Windows

Posted: Sat Jul 09, 2016 11:04 am
by onlyonemac
thehardcoreOS wrote:I don't like Linux because GRUB overwrites MBR and then I need to use GRUB to boot Windows. Also if I don't use my keyboard and select Windows, Linux boots. Linux is not really fun to install since you need to create 3 partitions for it... I will consider installing Ubuntu if that will make any difference, but then I need to find a way to recover MBR.
  • Back up your MBR before installing Linux, or use GRUB4DOS which can be chainloaded by the Windows MBR
  • Set Windows as your default bootloader entry
  • Use a swapfile inside your main Linux partition, that means you only need to create 1 extra partition not 2 extra partitions, or find a distro that you can install inside your Windows partition
Problem solves. Or you can set up a persistent Linux flash drive, which is probably all that you need for OSdev.

Re: Coding General Bootloader & Make File for Windows

Posted: Sat Jul 09, 2016 3:46 pm
by Combuster
Installing Linux is the fanboy's answer, it's not necessary. Your real error is mixing 101 concepts you don't understand and then insist using them all together at the same time. Learn to split up your problem.

There are the Babysteps you can work from. Bootloaders are sufficiently challenging that you do not want to use C for a loooong time. At least until your bootloader itself is actually capable of loading a binary from disk. If you decide not to write your own bootloader and use GRUB after all, there's also tutorials in the wiki for that.

Re: Coding General Bootloader & Make File for Windows

Posted: Sat Jul 09, 2016 3:57 pm
by iansjack
Combuster wrote:Installing Linux is the fanboy's answer, it's not necessary.
That's a ridiculous statement (the first part of it).

Suggesting the use of Linux is purely pragmatic. It's not necessary, it's just easier. There is undeniably more information available about setting up and using the necessary tools for OS development under Linux than under Windows. The most satisfactory way of using Windows for this purpose is to install some pretend Linux - i.e. CygWin - on top of it. It's easier just to cut out the middle man and use the tools directly.

Re: Coding General Bootloader & Make File for Windows

Posted: Sat Jul 09, 2016 4:23 pm
by Roman
thehardcoreOS wrote:I don't like Linux because GRUB overwrites MBR and then I need to use GRUB to boot Windows.
That's optional, you can employ a VBR install. As far as I know, Windows' boot manager should be able to chainload it then.
thehardcoreOS wrote:Also if I don't use my keyboard and select Windows, Linux boots.
GRUB can be set up to boot Windows by default or even not to boot anything automatically at all.
thehardcoreOS wrote:Linux is not really fun to install since you need to create 3 partitions for it...
That's completely false. You can lay out the partitions in any way, including a single partition setup.

To be honest, I want to advise you to learn to search the web – that's a very important skill for a programmer.

Re: Coding General Bootloader & Make File for Windows

Posted: Sat Jul 09, 2016 4:28 pm
by Roman
Talking about Windows, I should note that there is the Windows subsystem for Linux (WSL) which is basically an Ubuntu rootfs executed by the Windows NT kernel.

OS X (aka macOS recently) appears to be pretty much suitable for OS development too. The default clang toolchain that comes with Xcode is able to target *-none-elf targets, it just needs to be augmented with binutils (that can be easily built from source).

Re: Coding General Bootloader & Make File for Windows

Posted: Sun Jul 10, 2016 12:52 am
by Octacone
Guys please stop arguing and hello from Linux Ubuntu. Now I need to set up my GCC and Binutils aka long and painful process.