1 You need to download a m68k (elf) cross compiler for linux on i386. You
2 can get that one precompiled from
4 ftp://ftp.fu-berlin.de/unix/linux/mirrors/tsx-11.mit.edu/680x0/tools/i486
6 The size of that one is ~7.4MB and *should* also contains all the tools
7 you will ever need for cross compilation. If you cannot access this ftp
8 server for some reason then search for "cross-m68k-linux-*" on dogpile.com
10 You should extract this file into '/'.
14 Compile the kernel as follows starting in AROS/
18 ./configure --target=pp-m68k
20 cd config/m68k-pp-native/build-rom
23 TO START AROS FOR PALM ON XCOPILOT:
24 xcopilot -romfile aros.rom
29 - POSE seems to have a problem with 32 bits access to some of the registers.
30 USE 16 BITS ACCESS INSTEAD!!!
32 - Hardware: How do you get the coordinates from the touch screen?
33 How do you get notifications about pressed buttons?
35 Uploading elf code to the Palm
36 ------------------------------
38 - You MUST pass -Wa,-mc68000 as argument to gcc or -mc68000 to as
39 (assembler) because otherwise you might get 68020 instructions like
40 bsr.l <label> which do not exist on an mc68000.
53 ========================= OLD OLD OLD OLD OLD ================================
59 To cross-compile AROS for Palm devices you need an m68k-palmos-coff cross
60 compiler and some additional tools. Luckily you do not have to create them
61 yourself but can download a complete package from the following site:
63 ftp://ryeham.ee.ryerson.ca/pub/PalmOS/m68k-palmos-coff.tools-990108-linux-x86-glibc.tar.gz
65 The size is ~4.9MB and *should* contain everything you need to develop
66 PalmOS applications (if you really want to). You should extract it into '/'.
67 This should get you going for the beginning but this compiler has a couple
68 of disadvantages and sooner or later we will have to switch to a regular
69 m68k-linux elf (cross) compiler that allows us to build all of AROS. You
70 can get that one precompiled from
72 ftp://ftp.fu-berlin.de/unix/linux/mirrors/tsx-11.mit.edu/680x0/tools/i486
74 The size of that one is ~7.4MB and *should* also contains all the tools
75 you will ever need for cross compilation. If you cannot access this ftp
76 server for some reason then search for "cross-m68k-linux-*" on dogpile.com
78 You should extract this file into '/'.
81 Also since you probably want to extend AROS for Palm a little you might
82 want to download the dragonball documentation from the Motorola website.
83 The documentation tells you (almost) everything you need to know about the
84 Palm HW and its additional memory mapped registers.
86 http://www.motorola.com
88 Search for "dragonball" and then go to "documentation". Sigh, the size of
89 that thing is also >5MB.
93 Compilation (only the m68k-palmos-coff...) package from above is currently needed.
96 Cross compiling AROS is not supported by the configuration, yet, and
97 therefore compiling AROS for Palm is little messy, but it works anyway.
98 Here is what you should do. Start with a clean tree by typing the following
99 in the AROS/ directory
100 mmake .clean ; rm -rf bin
102 After that you need to create the main Makefile like you would do to compile
106 Also you need to build the tools first before doing anything else:
109 Now go into config/palm-native
110 cd config/palm-native
112 and start compiling the source tree with the given script 'compile'. This
113 will compile all linklibs, exec and maybe a couple of other libraries:
116 To upload it onto a palm device do the following:
117 cd boot ; make clean ; make send
119 You can also upload it to xcopilot by using the target 'emu' instead fo
120 'send' in the command line above.
126 The current status is that only exec multitasking works. One task draws a
127 vertical and a horizontal line onto the screen and moves them downwards
128 and rightwards respectively. The idle task (!) scrolls the visible area
129 pixel by pixel. To do so its priority is raised from -128 to 0 and
130 task switching is 'manually' enabled in the dispatcher.
131 Tasks are currently preempted at a rate of 1Hz.
136 Here is my suggestion of a roadmap on how we could get AROS running on
137 Palm devices as fast as possible:
139 - Replace the m68k-palmos-coff-gcc compiler with a m68k-linux elf compiler.
140 This will allow us to build larger executables than 32kb but downloading
141 AROS onto the Palm device (or emulator) will not be as easy anymore since
142 the Palm does not like the elf format.
144 - Write one program for PalmOS that checks the memory layout and sends its
145 findings to an AROS or Linux program. The program on AROS then loads
146 the m68k elf executable and relocates (!) it and then sends the chunks
147 to the Palm device. (Watch out where the supervisor stack pointer is
148 located such that that program does not overwrite the stack)
149 [I think the memory layout can be found out by reading some of the
150 systen registers 0xfffff???]
152 - Until now no changes should have been made to the source tree, unless
153 it could have been tested with the native Palm OS version of exec as
154 we have it right now.
156 - Introduce an irq hidd. The task switching handler should use the irq
159 - Try to write the serial hidd for debugging output over serial line.
161 - add all necessary libraries to the executable. This should not be
162 very difficult but will increase the upload time considerably.
164 - Write a graphics hidd. Should be real simple to do!! Check the dragon ball
165 documentation for what the LCD registers offer.
168 Knowledge (more or less)
171 - You will (currently) need a m68k cross compiler for palmos. You should
172 be able to find it on the aros ftp server. Unfortunately this compiler
173 will only allow to generate code sizes of up to 32kb and that only
174 allows exec to fit in and not much of anything else.
176 - The next step will be to generate aros with a m68k elf cross compiler
177 and write a loader program for PalmOS that will load AROS for Palm onto
178 the Palm device. The relocation of the executable should then be done
179 on the host (AROS or Linux) before uploading it to the Palm device.
181 - Debugging has become quite difficult since I switched
182 execution to user mode. Can only debug once in supervisor mode
185 - Something bad happens when string.h is included. All memset are
186 mapped to MemSet which takes a different order of parameters and
187 thus causes crashes. Therefore __string_h was defined to prevent
188 including that PalmOS include file which does the remapping.
189 (see config file for Palm)
191 - Do not try to build geninc. It will not create the right offsets for the
192 crosscompilation but for i386 instead! I wrote a c file instead with
195 - Fix Supervisor, Stackswap, ColdReboot (missing offsets in machine.i)
197 - Currently all interrupts are disabled in the dispatcher (my_dispatcher)
198 and only RTC is enabled at the end.
200 - For some reason jmp <label> seems to generate wrong code. It does not
201 jump to the address I want it to. Used 'bra' instead and that seems
202 to do the trick. Absolute addresses expressed through labels seem to be
203 a general problem with that compiler. Best is to use only relative
204 addresses with the coff type of compiler.
206 - Had to replace the addintserver file in rom/exec with a file that
207 has no references to custom chip hw. Otherwise this caused crashes due
208 to access to addresses that do not exist. It seems the #defines are
209 defined in the Palm case.
211 - The speed of the task switches depends on which flag is set in the RTC
212 register RTCISR (0xfffffb0e). Change it accordingly in exec/ints.S
213 and inithw.c, disable.c & enable.c .
214 (For nothing in the world I could get better task switching than @ 1Hz.)
216 - Try to get rid of all 'int's. They are 2 bytes long with the native
217 palm compiler. Once we move to the real m68k elf compiler this
218 will not be a problem anymore. So we might not want to do it.
220 - GCC optimization option -O3 seems to generate a little larger executable
223 - Hardware: How do you get the coordinates from the touch screen?
224 How do you get notifications about pressed buttons?
226 - Defined __DONT_USE_DEBUGMEM__ to make exec run on Palm
227 device. It is defined in the config file for Palm copyied to
230 - Memory allocated by PlamOS before entering AROS needs to be aligned!
231 See boot/exec.c code!
233 - The memory allocation function currently in use does not even allow
234 allocation of 0x10000 bytes. It simply returns NULL then.
238 Uploading elf code to the Palm
239 ------------------------------
241 - There must not be any symobols defines as common ('C') when the executable
242 is examined with 'nm'. Use '-dp' when linking to allocate space for such
243 kind of symbols in the .bss section.
245 - You MUST pass -Wa,-mc68000 as argument to gcc or -mc68000 to as
246 (assembler) because otherwise you might get 68020 instructions like
247 bsr.l <label> which do not exist on an mc68000.
252 Palm is a registered trademark of Palm Inc.