problem with imgboot trying to boot for the first time

General discussion about Visopsys.
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: problem with imgboot trying to boot for the first time

Post by andymc »

Sorry oscar, I didn't get around yet to doing the various experiments I wanted to try. I'm running Ubuntu 11.10, which is a bit older (it's now regularly telling me that it's unsupported and that I should upgrade).

I still suspect it'll be an issue with the runtime linking, perhaps when loading the shared libraries for the executable (like libc.so). There will probably be some change in the way the newer gcc or ld lay out the binaries, that my runtime linker isn't accounting for.

If I upgraded to some newer Ubuntu, perhaps I'd see it here too, though I don't like messing around with my dev environment too often! Upgrading the OS usually results in a bunch of work to get everything working smoothly again... Better maybe if I can just identify the issue using your binaries, and fix whatever needs fixing in the kernel or libraries.
oscar
Posts: 22
Joined: Thu Aug 15, 2013 4:23 pm

Re: problem with imgboot trying to boot for the first time

Post by oscar »

Hi Andy,

I think you're right and probably it's something related to the software version in my linux. I know that upgrading linux usually takes a lot of time (I'm also lazy upgrading to fedora 19 :lol: ), so I will try to use the same gcc and binutils that you have, and if possible I will use the same distro version as well. When I have something new about it I will tell you :)

Have a nice day!

Oscar
oscar
Posts: 22
Joined: Thu Aug 15, 2013 4:23 pm

Re: problem with imgboot trying to boot for the first time

Post by oscar »

Hello Andy,

I didn't tried to compile with your version of gcc and binutils, I want to do it soon. But I tried to use two Visopsys iso images that I compiled with VirtualBox in another laptop that works with Windows. One iso was compiled from an unmodified source code, while the other iso was compiled from a source in which I tried to port my two test programs.

When I run the isos, I obtained the imgboot error again, with the same details for both isos. But this time there are two variables that are different.
I attached the image, indicating with [ ] the two variables with a different value compared with the error that I obtain when I run them on my laptop.

Hope it helps you :) Have a nice day!

Oscar
Attachments
Visopsys_08.png
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: problem with imgboot trying to boot for the first time

Post by andymc »

...investigating. It seems as though simply adding your version of libwindow.so triggers the fault on my system. So, I'll need to go in-depth with the runtime loader tomorrow, to see what's different about it.
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: problem with imgboot trying to boot for the first time

Post by andymc »

It seems as if it may be a result of a known issue with my runtime linker/loader, given the presence of GNU_RELRO program headers in several of the shared libraries (.so) that your linker is generating.

From my collection of issues:
- 1865 - Investigate why having a GNU_RELRO program header in an ELF
shared library causes a page fault on execution. Doesn't seem to cause
any problems in program binaries. Can our ELF loader be equipped to deal
with it properly for libraries? Seems as if having "-static -lgcc" in
the linker command line triggers its creation.
...ongoing...
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: problem with imgboot trying to boot for the first time

Post by andymc »

Does adding the flag -norelro in the following places in your library Makefiles (src/lib/lib*/Makefile) solve the problem?

Code: Select all

${SHAREDLIB}: ${PICOBJS}
	${LD} -shared -nostdlib -norelro [...]
User avatar
andymc
Posts: 589
Joined: Tue Nov 16, 2010 7:20 pm

Re: problem with imgboot trying to boot for the first time

Post by andymc »

Oops, it's actually -z norelro

I noticed that I was already using it in a couple of the Makefiles (and thus those .so files from you didn't have the offending section).

Here's a patch that will apply the changes. Run in the top-level visopsys source distribution directory:

Code: Select all

patch -p0 < norelro.patch
Attachments
norelro.patch.gz
(493 Bytes) Downloaded 907 times
oscar
Posts: 22
Joined: Thu Aug 15, 2013 4:23 pm

Re: problem with imgboot trying to boot for the first time

Post by oscar »

Hi Andy,

Yes, I will try it now and I tell you what happens :)
oscar
Posts: 22
Joined: Thu Aug 15, 2013 4:23 pm

Re: problem with imgboot trying to boot for the first time

Post by oscar »

I found that norelro.patch looks for 'liblic' folder in /src/lib, but this folder doesn't exist. The only folder that lefts in the /src/lib folder is 'libc'.
After modifying norelro.patch with the path to libc (insted of liblic), it worked but one error appeared:

Code: Select all

Hunk #1 FAILED at 47.
1 out of 1 hunk FAILED -- saving rejects to file src/lib/libc/Makefile.rej
Now I will built it and I will try to run it on VirtualBox. I'm using a source code that I just have extracted from the zipped source code. Let's see what happens :geek:
oscar
Posts: 22
Joined: Thu Aug 15, 2013 4:23 pm

Re: problem with imgboot trying to boot for the first time

Post by oscar »

Good news Andy! :dance:

Now all works weel until the Visopsys desktop appears :D
But... a new error appears, this time related to the process login :geek:

I attach an image in this post so that you can read it :)
Attachments
Visopsys_login_error.png
Post Reply