mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Patrick Oppenlander <pattyo.lists@gmail.com>
To: musl@lists.openwall.com
Subject: Re: vfork on ARM
Date: Mon, 4 Apr 2016 12:25:00 +1000	[thread overview]
Message-ID: <5701D07C.6010504@gmail.com> (raw)
In-Reply-To: <20160404001443.GH21636@brightrain.aerifal.cx>

On 04/04/16 10:14, Rich Felker wrote:
>> Do you know if v7-m has the hardware TLS registers?
> ...but it lacks the coprocessor register for TLS. However since the
> instruction to access it is representable in thumb2, the kernel could
> trap and emulate it. I think the people doing nommu ARM Linux stuff
> added a syscall for get_tls, but in theory that's just as costly as
> trap-and-emulate, so I'd rather get trap-and-emulate working so that
> the same binaries can run on v7-a without runtime selection of the TLS
> method.

Trap-and-emulate makes perfect sense to me. It's common to fix floating 
point behaviours like this so why not TLS.

Actually, I had a question on this point. I never got to the bottom of 
why ARM uses an architecture specific set_tls syscall rather than 
SYS_set_thread_area like i386 & others. Is this just a historic thing?

>>
>> Right now I'm working on my own small kernel which will (hopefully)
>> implement enough of the linux syscall interface to be useful. It's
>> meant for small embedded microcontrollers where 4MiB of RAM is
>> considered luxurious.
>>
>> It's based on the now abandoned Prex operating system
>> (http://prex.sourceforge.net/) but is a major fork which goes back
>> to a traditional monolithic kernel model. I've replaced the C libary
>> with musl and userspace is currently toybox.
>>
>> I'm planning on releasing on github (BSD or no-license) once I can
>> boot the first targets (arm-mmu and arm-nommu) to a working
>> userspace and pass some unit tests.
>>
>> Maybe once I've learnt enough about how all this stuff works I'll be
>> able to contribute to other projects like linux/musl.
> If your intent to run a whole userspace environment on it, or just a
> single process? If the latter, plain (non-FDPIC) PIE ELF is not a bad
> solution at all. It precludes XIP from ROM, but at least you don't
> have repeated per-process overhead from many instances of same
> executable.

It will be single user, single session, multi process. One long term 
goal is to be self hosting.

Why does PIE preclude XIP? I hoped that it would still be possible to 
XIP a static PIE ELF if the XIP address is known at link time, then use 
a GOT. I haven't thoroughly studied the ABI's here yet and may well be 
barking up the wrong tree.

Worst case scenario I'll just start with relocatable code for nommu and 
work from there.

FDPIC is quite a compelling solution. Hopefully this gains some momentum.

         Patrick



  reply	other threads:[~2016-04-04  2:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01  0:42 Patrick Oppenlander
2016-04-01  1:53 ` Rich Felker
2016-04-03 23:18   ` Patrick Oppenlander
2016-04-04  0:14     ` Rich Felker
2016-04-04  2:25       ` Patrick Oppenlander [this message]
2016-04-04  3:37         ` Rich Felker
2016-04-04  6:56           ` Patrick Oppenlander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5701D07C.6010504@gmail.com \
    --to=pattyo.lists@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).