Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel Panic #8

Open
professor-2390 opened this issue Feb 22, 2021 · 25 comments
Open

Kernel Panic #8

professor-2390 opened this issue Feb 22, 2021 · 25 comments

Comments

@professor-2390
Copy link

Hey Poncho big fan hope you will solve the problem please
when i run the os it shows a message said Kernel Panic general protection fault detected i dont have any idea how to solve it

@ghost
Copy link

ghost commented Feb 22, 2021

What episode are you on?

@professor-2390
Copy link
Author

PCI 2

@ajh123
Copy link

ajh123 commented Mar 4, 2021

Same on 20

@Tidone
Copy link

Tidone commented Mar 4, 2021

Edit your run.bat and make sure to include the option -machine q35 to your call to qemu-system-x86_64.

You get the general protection fault if this option is not specified!

@ajh123
Copy link

ajh123 commented Mar 5, 2021

works for me, do u know everything? Apart from I'm on a Mac

@ajh123
Copy link

ajh123 commented Mar 5, 2021

However the mouse is not there, might be because qemu window is bigger than my screen and the pointer is far away.

@ajh123
Copy link

ajh123 commented Mar 5, 2021

Or maybe my qemu dose not have ps2 mouse emulation enabled?

@ajh123
Copy link

ajh123 commented Mar 5, 2021

Unless e20 dose not show mouse

@professor-2390
Copy link
Author

i am on kali linux

@ajh123
Copy link

ajh123 commented Mar 5, 2021

good for you

@Tidone
Copy link

Tidone commented Mar 5, 2021

Unfortunately I can't help you with that one.
I just installed qemu on my Macbook (Pro 2019, macOS Big Sur 11.2.2) and the mouse pointer worked as expected on Ep17 and Ep20.
And yes, my qemu window was bigger than the screen as well, but not by much.
(I could not get the linker to work and I don't have time to look into this, so I copied the CustomOS.img over from my Windows machine, but that should not really make a difference).

I will look into this when I have more time, but don't expect much. In my opinion macOS is not suitable at all to do any serious productive work on, so the first thing I did when I got the macbook was to install Ubuntu as a dual boot system.

@Tidone
Copy link

Tidone commented Mar 5, 2021

By the way, did you capture the mouse inside qemu?
If not you have to click inside the window to make sure the mouse is passed over to qemu.

You can also try to enter some keys on your keyboard and see if they are printed on the screen.

@chiboubys
Copy link

qemu keep reloading after adding the heap init

@ajh123
Copy link

ajh123 commented Mar 6, 2021

how do i get it running in virtual box?. Also my mouse in qemu works in over os'. also the keys dont seem to be appearing unless there out the bottom of my screen. And i do to use ubuntu for building :)

@ajh123
Copy link

ajh123 commented Mar 6, 2021

when i follow the Real Hardwaretutorial my virtual box kernel panics with general protection fault

@Tidone
Copy link

Tidone commented Mar 6, 2021

When I try to load the kernel in vbox, it also crashes, and shuts down when the kernel is trying to activate the PML4 in PrepareMemory().
I did not find a solution for that.

I would suggest opening a new Issue to avoid polluting this one any more, seeing that the original problem has been solved.

@professor-2390
Copy link
Author

i follow the Real Hardwaretutorial my virtual box kernel panics with general protection fault

me too

@chiboubys
Copy link

i follow the Real Hardwaretutorial my virtual box kernel panics with general protection fault

me too

the same

@professor-2390
Copy link
Author

we have to solve it

@ajh123
Copy link

ajh123 commented Mar 7, 2021

if we can get it working in vbox, it will work anywhere ;)

@professor-2390
Copy link
Author

if we can get it working in vbox, it will work anywhere ;)

yeah maybe but we have to Figure It Out

@algorithmx51
Copy link

algorithmx51 commented Mar 8, 2021

if we can get it working in vbox, it will work anywhere ;)

thats totally not true, it usually works on vbox and not on real hardware

@chiboubys
Copy link

chiboubys commented Mar 9, 2021

Performance in virtual box are much nicer than qemu with no hanging or errors especially that virtualbox has natively support for uefi so there's no need for ovmf binaries.

  • To Run the OS, you must create an iso image (Linux)
  • Install xorriso sudo apt-get install xorriso
  • Install mkisofs sudo apt-get install mkisofs
cd kernel\bin
mkdir -p iso
rm -rf iso/*.iso
rm -rf iso/*.img
cp CustomOS.img iso
xorriso -as mkisofs -R -f -e CustomOS.img -no-emul-boot -o ./iso/cdimage.iso iso
  • After that create a new Cirtual Machine in virtual box
  • Settings->system Enable EFI (CheckBox)
  • Settings->Storage->Adds Optical Drive-> choose the iso file
  • Start the VM

image

PS : If you wan't to update your Makefile (make buildiso)

WORK_DIR = $(shell pwd)
buildiso:		
	mkdir -p $(WORK_DIR)/$(BUILDDIR)/iso
	rm -rf $(WORK_DIR)/$(BUILDDIR)/iso/*.iso
	rm -rf $(WORK_DIR)/$(BUILDDIR)/iso/*.imgcp $(WORK_DIR)/$(BUILDDIR)/CustomOS.img $(WORK_DIR)/$(BUILDDIR)/iso
	xorriso -as mkisofs -R -f -e CustomOS.img -no-emul-boot -o $(WORK_DIR)/$(BUILDDIR)/iso/cdimage.iso $(WORK_DIR)/$(BUILDDIR)
runvbox:
	vboxmanage startvm "vm name"

Add the virtual box directory to path (C:\Program Files\Oracle\VirtualBox)

@Tidone
Copy link

Tidone commented Mar 9, 2021

If you don't want a Page Fault in the PCI and later episodes you should also make sure to set the chipset to ICH9 in the System settings.

Furthermore you can change the screen resolution with
VBoxManage setextradata "vm name" VBoxInternal2/EfiGraphicsResolution 1920x1080

You should also make sure to use the latest version of vbox, because I first tried with v5.x and could not boot the vm because it always threw a Triple Fault when the kernel tried to setup the virtual memory.

@ajh123
Copy link

ajh123 commented Mar 10, 2021

the main.efi file is found by startup.nsh however it is "not recognized as an internal or external command, operable program, or script file"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants