aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: abd39e3e4d38b95377768e0c5775b3d75cb9b213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# AVL68K - M68k platform for embedded/test equipment

(work in progress, most of these are lies until those things are actually built)

## Building GCC

I recommend building the same version of GCC you already have present in your
distro. Otherwise, several more packages it depends on will also need to be
rebuilt. Modern GCC still supports the 68010 just fine.

Binutils 2.35

```
mkdir build && cd build
../configure --target=m68k-elf --prefix=/opt/m68k-elf-gcc --with-sysroot --disable-nls --disable-werror
make
sudo make install
```

GCC 10.2

```
mkdir build && cd build
../configure --target=m68k-elf --prefix=/opt/m68k-elf-gcc --disable-nls --enable-languages=c,c++ --without-headers --with-cpu=m68010 --disable-libssp --disable-libsanitizer --disable-libquadmath --disable-libgomp --disable-nls
make all-gcc
make all-target-libgcc
make install-gcc
make install-target-libgcc
#--disable-float --disable-atomic
```

Make sure binutils is installed and in the PATH before building GCC or it will crap itself mysteriously. Why the GCC project hasn't heard of sanity checks and error messages is beyond me, but oh well.

## Directories

In many directories, the main component may be built simply by typing `make`.

- `68kos` - 68KOS operating system
  - `68kos/68kos_dll` - `68KOS.DLL` main kernel executable
  - `68kos/system_dll` - `SYSTEM.DLL` main support library, libc, etc.
  - `68kos/68kos_ld` - Dynamic linker/loader, including `LD.DLL` for the OS and
    `dex_builder` for the host toolchain.
  - `superfs_*` - SuperFS build source directories for each implementation
  - `toolchain` - Build tools, compiler toolchain parts (linker scripts, etc)

- `Debug24` - Debug24 is the plug-in debugger for the reference implementation,
  and recommended for use with all 24-bit AVL68K implementations.

  - `Debug24/Debug24_hw` - EDA files for the debugger hardware
  - `Debug24/Debug24_fw` - Firmware for the onboard microcontroller
    - `Debug24/Debug24_fw/emu` - Emulation support for testing debugger on PC
  - `Debug24/avl68kdb` - Implementation of the `avl68kdb` debug control
    software for Debug24

- `spec` - General specifications for AVL68K

- `interfaces_datasheets` - Documentation for various interfaces and subcircuit
  datasheets for the reference implementations.

## Building and running 68KOS

1. In the `Debug24` directory, install `avl68kdb`
   (`pip install --user -e avl68kdb`)
2. In the `68kos` directory, use `make BOARD_NAME` (`make icm68k`) to compile
   68KOS and build a superfs image for a board.
3. Attach the Debug24 to the board, and connect USB to it.
4. Using `avl68kdb`, load the superfs:

```
# Write the image into RAM, launch the debug terminal, and run:
avl68kdb start -t 68kos/superfs_icm68k.srec

# Optional: copy it into flash so it will run automatically next time
avl68kdb commit      # or pass -c to start

# The background daemon will keep running until the debugger is disconnected.
# If you need to kill it manually, just do
avl68kdb kill
```

To flash 68KOS onto a real memory card, simply write `superfs_BOARD_NAME.srec`
into its EEPROM (note that the exact procedure is TBD as no non-debugger
memory card has yet been built).