Page 2 of 2

Re: Help! My OS won't boot on physical hardware.

Posted: Sat Jan 21, 2017 7:44 am
by iansjack
Your code is a bootloader, not a kernel. If it is missing the signature you should not be surprised that it doesn't boot.

Re: Help! My OS won't boot on physical hardware.

Posted: Sat Jan 21, 2017 7:57 am
by WaterOS
I've just used it as a bootloader and still doesn't work on my Acer. It works on VirtualBox but not my Acer!

Re: Help! My OS won't boot on physical hardware.

Posted: Sat Jan 21, 2017 8:04 am
by iansjack
What you call it doesn't matter. If it lacks the signature it won't boot on many configurations (including real hardware). That it boots on Virtual box tells you nothing.

TBH, there is little point at this stage in trying to run it on real hardware. But if you must, make sure that it is a spare computer with nothing important on it; eventually you will corrupt the hard disk.

Re: Help! My OS won't boot on physical hardware.

Posted: Sat Jan 21, 2017 8:06 am
by WaterOS
It's old. I've got the boot signature on my bootloader that loads the kernel with INT 13h. It works on VirtualBox but it doesn't work on my Acer. I boot it up and it just skips to the hard disk. It used to work before. With my own code, it works. However, the kernel on Real mode assembly I (http://wiki.osdev.org/Real_mode_assembly_I) doesn't work.

My Acer won't let the bootloader load the kernel.

Re: Help! My OS won't boot on physical hardware.

Posted: Sat Jan 21, 2017 8:29 am
by Brendan
Hi,
WaterOS wrote:I've just used it as a bootloader and still doesn't work on my Acer. It works on VirtualBox but not my Acer!
For booting from USB on real hardware, there's multiple potential pitfalls to avoid. These include:
  • Failing to have either a "valid looking" BPB in the first sector (to convince the BIOS it should treat the device like a floppy disk) or a "valid looking" partition table (to convince the BIOS to treat the device like a hard disk).
  • Having a partition table that doesn't load the 1st sector of the active partition and pass control to it using established ("de-facto") standards (because some BIOSs skip the MBR and boot "1st sector of active partition" instead).
  • Using the 4 bytes at offset 0x01BC in the MBR; as some malicious OSs (Windows) have usurped these bytes for a "disk signature" and will tamper with them even when the disk and filesystem/s do not belong to (and are not used by) these OSs.
Note that the tutorial you've referred to is a steaming pile of puke for multiple reasons; not just because it fails to do anything of the things I mentioned above, and not just because it fails to distinguish between "MBR" and "boot loader", and not just because it tries to build a shell in the middle of a kernel, and not just because it tries to build a kernel in the middle of a boot loader, and not just because it does none of the things that a boot loader actually needs to do; and not just because the code has multiple bugs (e.g. not doing "CLD" before "LOSDB").

For asking for help when things don't work, there's multiple pitfalls to avoid. These include:
  • Saying "it doesn't work" without saying if (e.g.) the BIOS doesn't recognise it as bootable, or if it starts but crashes or causes the computer to reboot (triple fault), or if it doesn't display "Hello World" correctly but otherwise works perfectly; or if it gets all the way to PCI enumeration but doesn't detect something, or any of about 123 billion other possible variations of "doesn't work".
  • Not providing any kind of code. This includes not providing a link to any code that you cut&pasted without learning from, not providing any changes you may have made to the code after you cut&pasted it, and not providing details on how you "install" it on a device.
  • Not providing any details of what you've tried and/or tested before asking what's wrong.
  • Not doing anything to try to find the cause of the problem before asking what's wrong.
:)

Cheers,

Brendan

Re: Help! My OS won't boot on physical hardware.

Posted: Sat Jan 21, 2017 12:06 pm
by Stoptheban100
Thank you, Brendan. By the way, who keeps banning me?

Re: Help! My OS won't boot on physical hardware.

Posted: Sat Jan 21, 2017 12:10 pm
by Brendan
Hi,
Stoptheban100 wrote:Thank you, Brendan. By the way, who keeps banning me?
I'm not too sure who started banning you; but the penalty for attempting to evade a (permanent or temporary) ban is a permanent ban; so now I'm also banning you.


Cheers,

Brendan