Getting GPF!!
Getting GPF!!
It has been a month since i achived to do some progress on my os. I just can't get interrupts to work! I've followed brokenthorn scheme but used GNU compiler since on linux... here is my code pleas help me i don't know what else to do.
https://github.com/Bonfra04/OS-DEV
https://github.com/Bonfra04/OS-DEV
Regards, Bonfra.
-
- Member
- Posts: 5575
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Getting GPF!!
Where does the GPF occur?
Have you tried running your code in a debugger to see where it starts misbehaving?
Have you tried running your code in a debugger to see where it starts misbehaving?
Re: Getting GPF!!
Just saying "I can't get xxx to work" is unlikely to elicit many responses. Have a read of this: https://wiki.osdev.org/How_To_Ask_Questions
It's not helped by the fact that there seems to be something wrong with your repository. I can't browse your files (and it's full of object files).
It's not helped by the fact that there seems to be something wrong with your repository. I can't browse your files (and it's full of object files).
Re: Getting GPF!!
I don't have those problems. I can browse the files and it seems to me they are mostly source files.iansjack wrote:I can't browse your files (and it's full of object files).
And you both are totally right: Original poster, please tell more details what you are actually doing and what precisely is causing the problem.
Have you done any sort of debugging? Either with a debugger or by letting your kernel write infos to the screen.
Re: Getting GPF!!
Strange - it looks OK to me now.
Re: Getting GPF!!
Not used a debugger (don't know how) but i think that is something to do with the pit/pic since if the kernel ends in a short time it behaves fine but if i set a loop so keep it running for enough time it throws the exception.. I've been trying since posted to fix but found nothing..Octocontrabass wrote:Where does the GPF occur?
Have you tried running your code in a debugger to see where it starts misbehaving?
Regards, Bonfra.
Re: Getting GPF!!
PeterX wrote:I don't have those problems. I can browse the files and it seems to me they are mostly source files.iansjack wrote:I can't browse your files (and it's full of object files).
And you both are totally right: Original poster, please tell more details what you are actually doing and what precisely is causing the problem.
Have you done any sort of debugging? Either with a debugger or by letting your kernel write infos to the screen.
Yes, i actually forgot to clean the bin-int folder but the sources are present. I've tried to make the kernel print the current state until exception and as i've specified the previous post it happens if the kernel runs for enough time to activate the pit interrupts
Regards, Bonfra.
Re: Getting GPF!!
I'd apology to all of you since i'm kinda new to OS-Devving and formus... also english is not my language so i have a little difficulty to express problems XD
Regards, Bonfra.
Re: Getting GPF!!
Now is the time to learn, whilst you have a trivial problem to track down. The knowledge gained will be invaluable as you run into more intractable problems.Bonfra wrote: Not used a debugger (don't know how)
Re: Getting GPF!!
ok.. really stupid question. How? i mean (following BrokenThorn tutorial) i should create a vfd, partcopy the bootloader in the floppy drive and then boot with bochs. since on windows 10 i did not achive to use vfd or partcopy; i used a windows vista virtual machine to install the bootloader in the vfd and poweriso to create an ISO of the drive. than took the iso to main pc and installed it to a usb-stick in wich i put the kernel bins. i then boot another device from the usb-stick. i know is very impractical but is the only way i fought of. any suggestions?iansjack wrote:Now is the time to learn, whilst you have a trivial problem to track down. The knowledge gained will be invaluable as you run into more intractable problems.Bonfra wrote: Not used a debugger (don't know how)
Regards, Bonfra.
Re: Getting GPF!!
Finally achieved to create a .ISO file containing the OS:
dd if=/dev/zero of=floppy.img bs=1024 count=1440
dd if=Boot.bin of=floppy.img seek=0 count=1 conv=notrunc
genisoimage -quiet -V 'BonsOS' -input-charset iso8859-1 -o BonsOS.iso -b floppy.img -hide floppy.img iso-int/
and it works fine... But.. the first stage bootloader does not find the KRNLDR.SYS file (second stage bootloader)..
i think it can't read files
launched qemu with:
qemu-system-i386 -boot d -cdrom BonsOS.iso
EDIT:
tried with hyper-v and got the same problem so i think is that the problem is in the way i generate the iso
inspecting the iso with poweriso:
also updated git-folder with commands to generate iso
EDIT2:
when burning the iso to a usb and booting a real hardware from it, triple-fault and reboot. but if i use the old system explained above with the same code it works fine
Regards, Bonfra.
-
- Member
- Posts: 5575
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Getting GPF!!
Why are you creating an ISO? Your bootloader only works with floppy disks, so you should be creating a floppy disk image. Qemu can boot from a floppy disk image, if that's what you're trying to do.Bonfra wrote:Finally achieved to create a .ISO file containing the OS:
(It's possible to make a CD that will boot as an emulated floppy disk, but you need a working floppy disk image first.)
Re: Getting GPF!!
i think i'm a total idiot! thanks a lot now i can use qemu with the floppy image and debug the os . But the main problem persist.. GPF how can i fix it? i really have no idea.. is it with the bootloader that messes up something or is the interrupts setup in the kernel?Octocontrabass wrote:Why are you creating an ISO? Your bootloader only works with floppy disks, so you should be creating a floppy disk image. Qemu can boot from a floppy disk image, if that's what you're trying to do.Bonfra wrote:Finally achieved to create a .ISO file containing the OS:
(It's possible to make a CD that will boot as an emulated floppy disk, but you need a working floppy disk image first.)
Regards, Bonfra.
Re: Getting GPF!!
Which part of "learning to use a debugger" isn't clear to you?