visopsys.org
http://visopsys.org/forums/

problem with imgboot trying to boot for the first time
http://visopsys.org/forums/viewtopic.php?f=3&t=185
Page 2 of 3

Author:  andymc [ Tue Sep 03, 2013 9:16 am ]
Post subject:  Re: problem with imgboot trying to boot for the first time

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.

Author:  oscar [ Tue Sep 03, 2013 10:35 am ]
Post subject:  Re: problem with imgboot trying to boot for the first time

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

Author:  oscar [ Fri Sep 06, 2013 5:26 pm ]
Post subject:  Re: problem with imgboot trying to boot for the first time

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
Visopsys_08.png [ 12.3 KiB | Viewed 6583 times ]

Author:  andymc [ Sun Sep 08, 2013 1:20 am ]
Post subject:  Re: problem with imgboot trying to boot for the first time

...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.

Author:  andymc [ Sun Sep 08, 2013 5:21 pm ]
Post subject:  Re: problem with imgboot trying to boot for the first time

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:
Quote:
- 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...

Author:  andymc [ Sun Sep 08, 2013 5:45 pm ]
Post subject:  Re: problem with imgboot trying to boot for the first time

Does adding the flag -norelro in the following places in your library Makefiles (src/lib/lib*/Makefile) solve the problem?
Code:
${SHAREDLIB}: ${PICOBJS}
   ${LD} -shared -nostdlib -norelro [...]

Author:  andymc [ Sun Sep 08, 2013 8:26 pm ]
Post subject:  Re: problem with imgboot trying to boot for the first time

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:
patch -p0 < norelro.patch


Attachments:
norelro.patch.gz [493 Bytes]
Downloaded 347 times

Author:  oscar [ Mon Sep 09, 2013 11:42 am ]
Post subject:  Re: problem with imgboot trying to boot for the first time

Hi Andy,

Yes, I will try it now and I tell you what happens :)

Author:  oscar [ Mon Sep 09, 2013 1:59 pm ]
Post subject:  Re: problem with imgboot trying to boot for the first time

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:
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:

Author:  oscar [ Mon Sep 09, 2013 2:01 pm ]
Post subject:  Re: problem with imgboot trying to boot for the first time

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
Visopsys_login_error.png [ 109.79 KiB | Viewed 6565 times ]

Page 2 of 3 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/