segment register usage (was: Re: 386/486)

Matthew Dillon dillon at apollo.backplane.com
Thu Jul 24 01:03:15 PDT 2003


:Ah, that reminds me. Which segment registers can user applications
:expect to be usable throughout DragonFlyBSD's development? I'm asking
:because wine and multithreaded sbcl expect the %fs register to not get
:clobbered, to store thread-local data there.

    The kernel saves and restores all the segment registers, but as per
    Julian libc is expected to be able to use %gs.  So that leaves %es
    and %fs for third-party use.

:Also, will you remove the requirement to recompile the kernel with
:option USER_LDT to get access to the i386_set/get_ldt functions? These
:are really useful if you have a free segment register to point to an LDT
:containing thread-local data.
:
:Anyway, good luck getting DragonFlyBSD up; you all seem to be doing very
:well. Best,
:-- 
:Andreas Fuchs, <asf at xxxxxxx>, asf at xxxxxxxxx, antifuchs

    That's fairly i386-specific, I would hate it if people got used to
    using those functions.  A better solution would be some sort of 
    kernel-supported abstraction which we would just happen to be able
    to optimize to USER_LDT operations on i386.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list