Page 2 of 2

Re: Visopsys 0.91 - Return of the RAMdisk?

Posted: Sun Mar 28, 2021 10:36 pm
by andymc
Hi Qmastery,

Ok, that sounds like the best solution for the time being -- making it 2.88. Of course the binaries I'm building now with GCC 9 have some kind of bug in them; they crash on kernel startup. I'm trying to debug that first. But also, I'm in the middle of moving house, so it'll be a little bit longer before I have time to sort it all out. When I do, I'll do a proper 0.91 release for it, with whatever fix might be needed for RAM disk booting.

Andy

Re: Visopsys 0.91 - Return of the RAMdisk?

Posted: Wed Apr 07, 2021 9:33 am
by andymc
Just an update: I'm experimenting with using clang now, in place of gcc. It looks promising, size-wise, but the kernel still crashes on startup, in what looks like the same sort of way. I think it's probably a linking issue.

Re: Visopsys 0.91 - Return of the RAMdisk?

Posted: Tue May 04, 2021 11:40 pm
by andymc
I'm getting there, slowly. Yes, the newer GNU ld outputs a kernel executable that's quite different. Most notably, it has moved the read-only data out of the code section, and into its own loadable section. My BIOS OS loader isn't equipped; it's necessarily fairly simple-minded w/r/t ELF layout, as it only ever has to load a single, known file. I'll work on fixing that up, so that it works with both the older ld layout, and the new. Or at least the new!

Re: Visopsys 0.91 - Return of the RAMdisk?

Posted: Mon Jun 21, 2021 11:27 am
by andymc
Unfortunately, it gets worse. Even with a custom linker script, the kernel that I'm building is not usable as a kernel.

I think there's too much Linux optimization going on here now -- the latest GCC on Mint creates an executable that's effectively relocatable and requires runtime loader fixups (which the OS loader does not and should not do). This may be the reason for the inexplicably increased file size, as well.

I've tried further fiddling with the compiler args, but I'm not sure I can get this GCC to create the executable I need. I may have to finally bite the bullet and implement a GCC cross-compiler target for Visopsys. It's probably something I should have done a while ago; although after creation it has to be maintained, without it you're vulnerable to these changes.

Andy

Re: Visopsys 0.91 - Return of the RAMdisk?

Posted: Mon Jun 28, 2021 10:40 pm
by andymc
Breakthrough!

I took the plunge and integrated a GCC cross-compiler into the Visopsys build system. I'm back to being able to build a working system, and the executable size problem is solved. I should be able to investigate this RAMdisk thing now, and should be able to (still) fit the result on a 1.44M floppy image.

In the end, I *think* the issue was PIE (position-independent executables) being on by default in the current GCC on my system. Had I understood that sooner, I probably could have solved my problems with a compile-time argument. But in the end, this is better, and probably something I should have done a long time ago. Now I'll be building with a compiler that's a known quantity, and be in complete control of what gets built (and linked).