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

lk can't run on AMD Dell Ryzen7 #202

Open
eastmoutain opened this issue Aug 29, 2017 · 2 comments
Open

lk can't run on AMD Dell Ryzen7 #202

eastmoutain opened this issue Aug 29, 2017 · 2 comments

Comments

@eastmoutain
Copy link

hi
I managed flashing LK kernel and creating a bootable USB device driver, it can boot on any Intel computer, but failed on AMD Dell Ryzen7.

Here is experiment procedures:
1. run ./script/do-qemux86 -6
this will generate lk.elf
2. create an ISO image
a) create a directory tree looks like bellow. note '^' stands for space key
isofile
|---boot
|^^^|---grub
|^^^|^^^|---
b) copy your lk.elf(find it in your lk build directory) into isofile/boot directory, and create a grub.cfg file under grub diretory.
c) fill grub.cfg with the following lines
set timeout=0
set default=0
menuentry "little kernel" {
multiboot /boot/lk.elf
boot
}
d) then your isofile directory tree looks like:
isofile
|---boot
|^^^|---grub
|^^^|^^^|---grub.cfg
|^^^|---lk.elf
run grub-mkrescue -o lk.iso isofile, then lk.iso will be created.
3. create a bootable USB device driver
run sudo dd if=isofile.iso of=/dev/sdb. Assume your USB device appears as "/dev/sdb" under "/dev" directory.
4. boot computer
Inert the bootable USB device into computer's USB slot, and boot the computer in legacy mode(configured in BIOS) from USB device.

On any recently Intel processor Computer, it works fine, but failed to boot up on AMD processor Computer.

I added the following debug info in "arch/x86/64/start.S" to print "OK" and then halt the processor
movl $0x2f4b2f4f, 0xb8000
hlt

It should print "OK" on screen if I insert the snippet at the point before enabling Paging, but won't print after paging is enabled.

It's reasonable that after paging is enabled, CPU should fed with virtual address, so I add kernel offset 0XFFFFFFFF80000000 to 0xb8000 in order to print message on screen.
mov $0XFFFFFFFF8000b8000, %rax
movl $0x2f4b2f4f, (%rax)
hlt

It looks perfect and should work now, however it still can't print the massage.

So am not sure what's going on with LK or AMD processor, I have no idea about that!!!

@travisg
Copy link
Member

travisg commented Aug 29, 2017 via email

@eastmoutain
Copy link
Author

thank you very much, i fixed the issue after comparing start.S file with magenta.

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

2 participants