I converted my OS .img file to .iso using mkisofs, and flashed it to an USB pendrive using UNeetBootin (because Rufus refused to flash the ISO).So, I plugged the USB into the computer (the computer is not very old, 5 years old) and nothing. The BIOS does not boot my OS. Okay, what's next? I tweaked a little bit the BIOS configuration, in order to boot my non-UEFI system.Now it boots, but...This is what I get:(sorry for the bad quality of the pics)Beautiful. I don't know what is the problem.Any ideas?

It could be anything.Is your entire code available? Since it is custom,if you booted with USB and were using Floppy Disk Emulation (FDD) the BIOS may have clobbered some of your code and data by blindly writing drive geometry data into your bootloader. If you are using USB with FDD Emulation I recommend consider putting a BIOS Parameter Block in your boot sector. See this SO answer: https://stackoverflow.com/a/47320115/3857942 . I'm suggesting you do that to eliminate one possibility. Other issues could be not having A20 properly enabled or you relied on a segment register being initialized when on real hardware it may not have been. I haven't seen your kernel, and it is hard to tell how far your code got just by looking at the pattern on the screen.I'm just tossing ideas out there.

I found the problem, I was calling an APM function. As spected in an modern APM no longer exists.Removed that call, and it boots (it prints the "loading" message), but it gets stuck when jumping to protected mode.

I remember you now. You posted this APM question on SO: https://stackoverflow.com/questions/546 ... ected-mode . I actually wrote some code for that but never got around to cleaning it up and posting an answer.Think I saw a comment you were potentially looking for another answer - I had assumed one that may have workable code.

As for not getting into protected mode, could be a variety of things. Do you have all your code available to look at? Could also be something to do with how you burned the ISO (a possibility, but not likely).

I remember you now. You posted this APM question on SO: https://stackoverflow.com/questions/546 ... ected-mode . I actually wrote some code for that but never got around to cleaning it up and posting an answer.Think I saw a comment you were potentially looking for another answer - I had assumed one that may have workable code.

As for not getting into protected mode, could be a variety of things. Do you have all your code available to look at? Could also be something to do with how you burned the ISO (a possibility, but not likely).

Tomorrow I post the code, now it's too late here. Also, maybe is the ISO, who knows.

Have you tried to print anything out (use print_string to print a message) in boot2.asm as the first thing at label proc_modebefore going to protected mode to ensure that it even got that far? I'm wondering if it even loaded the next part from disk.

I'm wondering if you considered dd'ing disk.img directly to the USB device and set your BIOS to boot as USB with floppy drive emulation.

Have you tried to print anything out (use print_string to print a message) in boot2.asm as the first thing at label proc_modebefore going to protected mode to ensure that it even got that far? I'm wondering if it even loaded the next part from disk.

I'm wondering if you considered dd'ing disk.img directly to the USB device and set your BIOS to boot as USB with floppy drive emulation.

Ok, I added a call to print_string like you told me, and magically it booted again, but, it still stuck in real mode, and the print_string call that I added after the proc_mode label, does not get called.

When I wrote that bootloader code it was specifically for Floppy Disk media. I'm wondering if the way you built the ISO, burned it and then set your BIOS to boot has done something. Possibly you need to change the bootloader code to use int 13h/ah=42h. An enhancement to the code I wrote would be to check if the drive you are reading supports extended disk BIOS functions and use them. If it doesn't it falls back to int 13/ah=2h.

Right now, the process of building the ISO, burning it, and what your BIOS is set to is likely factoring into this. At this point I highly doubt it is a buggy BIOS for this kind of thing. It seems you are using Windows to burn your image? I'd try using Chryscome's DD for Windows to place disk.img onto the USB drive directly and then set the BIOS to boot using Floppy Disk Drive emulation. I wrote a Stackoverflow Article (the second part) that includes instructions on using it: https://stackoverflow.com/a/36052385/3857942 .

In Windows with a console window in Administrator priveleges you could issue a command like:

dd if=disk.img od=<driveletterofUSB>: bs=512

Where driveletterofUSB is the drive letter followed by a colon.Note it doesn't use of= it uses od= which is special to this version of DD for Windows. Once DD'ed you need to safely eject the USB device (right mouse click the USB device icon on the task bar at the bottom) to ensure all the data is properly flushed to the USB device.

When I wrote that bootloader code it was specifically for Floppy Disk media. I'm wondering if the way you built the ISO, burned it and then set your BIOS to boot has done something. Possibly you need to change the bootloader code to use int 13h/ah=42h. An enhancement to the code I wrote would be to check if the drive you are reading supports extended disk BIOS functions and use them. If it doesn't it falls back to int 13/ah=2h.

Right now, the process of building the ISO, burning it, and what your BIOS is set to is likely factoring into this. At this point I highly doubt it is a buggy BIOS for this kind of thing. It seems you are using Windows to burn your image? I'd try using Chryscome's DD for Windows to place disk.img onto the USB drive directly and then set the BIOS to boot using Floppy Disk Drive emulation. I wrote a Stackoverflow Article (the second part) that includes instructions on using it: https://stackoverflow.com/a/36052385/3857942 .

In Windows with a console window in Administrator priveleges you could issue a command like:

dd if=disk.img od=<driveletterofUSB>: bs=512

Where driveletterofUSB is the drive letter followed by a colon.Note it doesn't use of= it uses od= which is special to this version of DD for Windows. Once DD'ed you need to safely eject the USB device (right mouse click the USB device icon on the task bar at the bottom) to ensure all the data is properly flushed to the USB device.

I get this error from dd (Windows)

Code:

rawwrite dd for windows version 0.6beta3.Written by John Newbigin <jn@it.swin.edu.au>This program is covered by terms of the GPL Version 2.

Device d: is a link to \\?\Device\HarddiskVolume31\\?\Device\HarddiskVolume31 is a partition on \Device\Harddisk10 Error writing file: 5 Acceso denegado01+0 records in0+0 records out

Using this flags:

Code:

dd if=disk.img od=d: bs=512

Tried using D: and D:\, with no luck...Ugh, what a bad luck I have! (I'm in Administrator mode)

Did you heed the notice to use command prompt in with Administrator privileges? A regular user doesn't have the ability to write to the beginning of the device. You can right mouse click the windows COMMAND program and select Run as Administrator

Last edited by MichaelPetch on Sun Feb 17, 2019 3:06 pm, edited 1 time in total.

Who is online

Users browsing this forum: Bing [Bot] and 10 guests

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