It turns out that there is not very much "glue" code required to convert the UEFI OS (it meets my definition of OS, anyway), into a mini Win64 clone.
Especially the consistent calling convention in UEFI, MSVCRT.DLL and KERNEL32.DLL means not even assembler stubs (or C90 extensions) are required between these things.
So "University Challenge x64" available at http://pdos.org provides such a system, including toolchain, all public domain. Source code is on the UC386 disk.
One sample Win64 executable is provided.
The sample Win64 executable will exit, because I don't currently increment the runnum, because I haven't had this exact scenario before, and need to check the best way of doing that.
It would be really good to have some academic rigor applied to this.
ie what do you think of the design - or concept?
Note that the only thing missing is a C90-compliant compiler. I only have a subset of C90 available, and even that will only allow you to produce EFI applications. Not sure if Win64 can be supported via the same method - haven't looked into it.
PDOS/x64
Re: PDOS/x64
While I haven't had the chance to try out PDOS yet or look into it deeper, I did enjoy the humor on the site.
Writing a bootloader in under 15 minutes: https://www.youtube.com/watch?v=0E0FKjvTA0M
Re: PDOS/x64
Thanks. Glad someone appreciates it. You should check out my "rules" in the PDOS Discord channel too.BigBuda wrote:While I haven't had the chance to try out PDOS yet or look into it deeper, I did enjoy the humor on the site.
Re: PDOS/x64
I now have a new public domain C compiler that is close enough to C90 compliance to cope with my entire OS/toolchain code base.kerravon wrote:Note that the only thing missing is a C90-compliant compiler.
And the concept has basically been fully proven now - I have a mini Win64 clone. Completely public domain with C source code. Caveats - a little bit of the code is C99 rather than C90 ("long long" can't really be fully avoided in Win64 - but it is mostly avoided), and the C compiler is actually generated so the code is a bit difficult to read - but not totally impossible to modify.
Re: PDOS/x64
This turned out to be premature. I received a Chinese computer (with a Chinese x64 even - Zhaoxin) - and expected it to work, but there were some faults in PDOS (not seen on Virtualbox) that could have been show-stoppers. So my heart was in my mouth as I struggled to find the various problems. But fortunately they were all resolved and you can see two photos of real hardware here: https://groups.io/g/hercules-380/message/2696kerravon wrote:And the concept has basically been fully proven nowkerravon wrote:Note that the only thing missing is a C90-compliant compiler.