Search code examples
clinuxgcc64-bitnachos

Installing Nachos 3.4 Error cast from void* to int loses precision


I'm trying to install Nachos 3.4, I'm using Linux 64 bit and I have a problem, the error is casting from void* to int loses precision [-fpermissive]. I have searched many times and tried many ways such: using intptr_t, long, ,static_cast<int> and so on. But they didn't work, I can not use C or C++ library like stdint.h, cstdint.h, iostream, ... I also intend to use a cross-compiler but I have no clue. Please help me, thanks very much. enter image description here


Solution

  • Nachos is 32-bit only. You are essentially trying to compile it for 64-bit, and it won't work; it is written to work only on ILP32 data model. It also requires GCC 3.4, as it expects literal string constants to be mutable, and later GCC versions do not support that option, -fwritable-strings, at all: the code may compile without the flag, but the binaries segfault.

    In essence, nachos is horribly outdated.

    Your best bet is to install Debian 3.1r8 in a virtual machine (virtualbox for example), and compile and run Nachos there.