Before:
16-bit addressing can only reach 32K of code.
16-bit addressing can only reach 32K of code.
After:
32-bit addressing can access many more K of code!
32-bit addressing can access many more K of code!
I have enough code together to at least start compiling and testing the main parts of the lwip stack. Unfortunately, when I include the PPP module, I get an error at link time:
# Reference to "___MAIN" out of range # Segment 'CODE'(1), module "%__MAIN"… # Error: PC-relative offset of reference from code does not fit into 16 bits # Error 3011 while writing output file # Error: PC-relative offset of reference from code does not fit into 16 bits # ILink - Execution terminated!
32-bit address in -model far (diagram from Apple's Mac OS Runtime Architectures) |
The error is apparently because the addition of PPP puts the code segment size over 32K. The classic 68K runtime architecture uses 16-bit addressing for code and data which maxes out at 32K. MPW has a few options to overcome this, including code segment management and different jump table options.
For now, I will be using the -model far option which allows for 32-bit addressing. Not sure how compatible this will be with older Mac Systems, but it seems like the easiest solution until I can segment the code.
The result is that it builds. However, I can't test it on the G4 because I have used the oldest serial port code I could find and the G4 doesn't have serial ports that the Classic Environment can recognize. Testing on Mac SE to come!
No comments:
Post a Comment