Messages in this thread |  | | From | Systemkennung Linux <> | Subject | Re: NT and stuff .... | Date | Wed, 3 Jul 1996 13:39:03 +0200 (MET DST) |
| |
Hi,
> >> How hard would it be to make the Linux/Mips kernel run > >> either big or little endian binaries? > > > Such a bi-endian kernel is attractive especially for all the little > > endian MIPS systems built with NT in mind so that they can run the > > big endian IRIX or ABI conforming software. It's also good because > > it will make the access to commercial software easier. > > Why not just switch endianness as the system boots? > After you don't need the firmware anymore, switch to > big-endian code (and deallocate all the little-endian stuff).
Switching the byteorder of the kernel at boottime is a hairy thing. For all MIPS CPUs except the R4300i the byteorder for kernelmode is programmed into the CPU during hardreset from a serial EEPROM/EPROM/ROM. The byteorder is then unchangeable 'till the next hardreset.
Now it comes even worse - firmware and motherboard have to support both byteorders. Unfortunately there are systems out there that have fixed byteorder. Ie DECstations are wired to little endian, Sony NEWS is wired to big endian only. Other systems like my SNI RM200 PCI can be reprogrammed to the other byteorder by loading new firmware into the PROMs. This is a simple process - inset a boot disk, switch the machine on and then wait. After five minutes the new firmware has been programmed into your PROMs. If this process is terminated by something like your cat playing with the reset switch or a power fail the halfprogrammed PROMs are now unuseable and have to be replaced physically. In short - switching kernel byteorder isn't desireable; it's even unacceptable when you want Linux to coexist with some other OS like NT or Sinix.
The byteorder for usermode may be reversed by setting the "reverse byteorder" bit in the status register. This is only possible for usermode, not kernelmode.
Ralf
|  |