-
-
Notifications
You must be signed in to change notification settings - Fork 618
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
Get deathstar.com running in qemu #20
Comments
You're using Intel CPU bugs like Spectre and Meltdown have significantly increased the performance overhead of having an operating system. If we can find a way to democratize ring0 privileges by making each executable its own unikernel, then we can gain back the performance edge that was lost. Unikernels can move memory without copying it. They can do i/o without the 1us syscall cost. It feels like the next logical evolution for cloud computing environments, where diskless servers that just need network is the norm. |
As I said before, I tried with both
Make sense, and sure, I have to study better how cosmopolitan works under the hood and how it integrates with bare metal, but as I find something that I can contribute, I will for sure.
I completely agree with you, it would be amazing to see cosmopolitan moving in that direction in the future. |
Hi @jart,
Hence, the NXE bit of the EFER register must be set if XD is used. Otherwise, a page fault is triggered, with the RSVD error bit set.
As the code tries to perform a syscall, a triple fault occurs. I believe that Anyway, I have the fixes for 1) and 2), and I can send a PR separately for each of the two if you wish. As for 3), I'm still trying to understand. |
@Theldus deathstar.com now boots in qemu, thanks to you! https://justine.lol/cosmopolitan/cosmo-metal-qemu.png make -j12 o//tool/viz/deathstar.com
qemu-system-x86_64 -serial stdio -fda o//tool/viz/deathstar.com # boot in qemu
o//tool/viz/deathstar.com # run on local computer from userspace I'm very impressed by how quickly and perfectly you diagnosed the issue. The project should be fully caught up with all the claims I've made. New binaries are now published to https://justine.lol/. I hope I'll get the chance to review more issues and/or pull requests from you in the future. |
My pleasure, I am very happy to be able to contribute and also to see cosmopolitan finally* working on baremetal, now I can really play with it, and of course, whenever I find something I will try to contribute. * In fact there is still a tiny issue when trying to run deathstar.com or even hello.com: in your patch that corrects the CHS arithmetic, you compare the number of heads with the sector counter (cx) instead of head counter (dh), I believe something like: diff --git a/ape/ape.S b/ape/ape.S
index 6dd6e08e..c07ee98f 100644
--- a/ape/ape.S
+++ b/ape/ape.S
@@ -348,8 +348,8 @@ pcread: push %ax
jbe 2f
mov $1,%al
inc %dh # ++head
- cmp XLM(DRIVE_LAST_HEAD),%cx
- jb 2f
+ cmp XLM(DRIVE_LAST_HEAD),%dh
+ jbe 2f
xor %dh,%dh
inc %cx # ++cylinder
2: ret
@@ -1571,4 +1571,4 @@ __data_start:
.type __ubsan_types_end,@object Fixing this, everything works like a charm. Thanks for your time on this issue, I really appreciate it. |
Thanks again to @Theldus for reporting this
Thanks again @Theldus. The change is now integrated. I confirmed it's still working for me, in both Blinkenlights and QEMU. |
I'm not getting to run 'hello.com' provided in examples/ folder on bare-metal, If I run on Qemu (qemu-system-i386) I get:
on qemu-system-x86_64, the machine seems to restart in a loop (maybe tripple fault?)
My environment:
GCC 9.3, Binutils 2.33, Qemu 2.12.0, Bash 4.4.5, Linux v4.4.38, x86_64
Steps to reproduce:
* If I try to run on Qemu without running on Linux first, Qemu (both -system-i386 and -system-x86_64) get 'frozen' on:
Boot from Hard Disk...
.Am I missing something?
The text was updated successfully, but these errors were encountered: