./genassym > ../sun3/assym.hIt pulls in (via C "include" statements) a bunch of header files and then extracts and computes values from them. The output will be a bunch of C define statements like this:
#define SERIAL0_BASE 0xf5a000 #define PARALLEL_BASE 0xf59800 #define TIMER_BASE 0xf5a800 #define NUMCONTEXTS 8 #define NUMPMEGS 256 #define PGSPERSEG 16 #define PME_MEM_VIDEO 0xfe00fe00I'll note in passing that "locate" finds a sample assym.h file here:
SS32/sun/stand/src/sc.diag/src/assym.hThis may or may not be informational. We certainly want to generate our own, not use this one.
Some trivial changes (adding stdio.h and stdlib.h to the include list) pop up. Then this catches our attention:
union longmap { long longval; struct pgmapent pgmapent; };On the native x86 compiler, a "long" is 64 bits, whereas in the sun3 world it was certainly 32 bits. The obvious thing to do here is to use something more specific like "int32_t" from stdint.h or:
typedef int u32However, it would behoove us to inspect every file in the bootrom sources and check how and where long gets used. It probably only matters when we are using the native x86 compiler. Both the original sun compiler and cross gcc for the m68k should have both int and long the same and 4 bytes in size.
Tom's Computer Info / tom@mmto.org