Support for 64bit userspace.

Jayachandran C. c.jayachandran at gmail.com
Tue Jul 27 20:34:20 UTC 2010


Here's my initial work to get 64bit user space.  With this set of
changes, I can boot to the single user shell with n64 /sbin/init and
/bin/sh.  There are still issues to fix, and the dynamic loader is
still not working, but I think this would be a good time to get some
initial feedback.

The changes mainly add a 3 level page table for both userspace and
kernel. The PTE entries are 32bit still (this will be changed to 64bit
once I get the current code more stable) and the PDE entries are 64
bit, which would give us 40bit (9+9+10+12) virtual address space.

Managing a both 32bit and 64 bit pagetables in one pmap.c was tough,
so I have moved all the 64bit pmap code to a new file pmap64.c, and
added a config option for 64bit. But otherwise the 32bit code is
almost completely untouched. But once things are stable, we can see if
some part of pmap.c and pmap64.c can be move to a common file.

The changes have been grouped into (files are also at
http://people.freebsd.org/~jchandra/mips-n64/ )

mips-n64-other.patch - header file and other minor changes
- param.h - add PDRSHIFT/MASK for mid-level, rename SEGOFSET to
SEGMASK for consistency.
- _stdint.h/profile.h - 64 bit defs I missed in the last pass
- vm_machdep.c/pm_machdep.c - add UX bit to status register where needed.

mips-n64-asm.patch - changes for assembly files
- exception.S - add second level page table lookup
- excption.S/locore.S - enable UX in status
- exception.S - the kernel stack is in XKSEG, so we need to set KX
before saving registers
- support.S -  fuword should be 64bit in n64
- swtch.S kstack in XKSEG

mips-n64-pmap.patch - move 64bit code to pmap64.c
- revert the 64bit additions to pmap.c
- create pmap64.c which will be used in 64 bit compilation, (this has
some debugging code still in there, and there are still a few issues
I'm looking at)

mips-n64-config.patch - add config option for 64bit compile, so that
we pick pmap.c in 32bit and pmap64.c in 64bit compile. I'm not sure if
there is a better way to do this,.
- options.mips, mips/conf/DEFAULTS - adds options KERNEL_32 and
KERNEL_64, make KERNEL_32 default option
- files.mips - use pmap.c or pmap64.c depending on kernel_32 or kernel_64

rmi-n64-rge.patch
- support for 64 bit in RMI gmac driver.

Let me know your comments (buildworld needs -DWITHOUT_DYNAMICROOT
-DWITHOUT_CDDL -DWITHOUT_USB -DWITHOUT_BLUETOOTH, for now)

Thanks,
JC.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-n64-other.patch
Type: application/octet-stream
Size: 7280 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20100727/ebe84f6b/mips-n64-other-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-n64-asm.patch
Type: application/octet-stream
Size: 7107 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20100727/ebe84f6b/mips-n64-asm-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-n64-pmap.patch
Type: application/octet-stream
Size: 85508 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20100727/ebe84f6b/mips-n64-pmap-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mips-n64-config.patch
Type: application/octet-stream
Size: 1600 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20100727/ebe84f6b/mips-n64-config-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rmi-n64-rge.patch
Type: application/octet-stream
Size: 3237 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20100727/ebe84f6b/rmi-n64-rge-0001.obj


More information about the freebsd-mips mailing list