Visopsys 0.91 - Return of the RAMdisk?

General discussion about Visopsys. We'll create more specific forums if the number of posts justifies that.
User avatar
andymc
Posts: 576
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.91 - Return of the RAMdisk?

Post 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
User avatar
andymc
Posts: 576
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.91 - Return of the RAMdisk?

Post 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.
User avatar
andymc
Posts: 576
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.91 - Return of the RAMdisk?

Post 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!
User avatar
andymc
Posts: 576
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.91 - Return of the RAMdisk?

Post 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
User avatar
andymc
Posts: 576
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.91 - Return of the RAMdisk?

Post 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).
User avatar
andymc
Posts: 576
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.91 - Return of the RAMdisk?

Post by andymc »

I think I've got this whole RAMdisk booting thing sorted out now. I'm not quite sure why it stopped working between the custom version I made you, or version 0.85, or version 0.9, but anyway, I've made some fixes and hopefully improvements:

https://visopsys.org/files/misc/visopsy ... py-img.zip

Can you give this one a try if you're still following along with this thread? (I myself would probably have wandered off from boredom at this point, so I wouldn't blame you if you weren't!)
User avatar
andymc
Posts: 576
Joined: Tue Nov 16, 2010 7:20 pm

Re: Visopsys 0.91 - Return of the RAMdisk?

Post by andymc »

I went ahead and released version 0.91 with these fixes
https://visopsys.org/download/
Post Reply