Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing an OS for Motorola 68K processor. Can I emulate it? And can I test-drive OS development?

Next term, I'll need to write a basic operating system for Motorola 68K processor as part of a course lab material.

Is there a Linux emulator of a basic hardware setup with that processor? So my partners and I can debug quicker on our computers instead of physically restarting the board and stuff.

Is it possible to apply test-driven development technique to OS development? Code will be mostly assembly and C. What will be the main difficulties with trying to test-drive this? Any advice on how to do it?

like image 411
ulver Avatar asked Oct 12 '09 00:10

ulver


People also ask

Is the Motorola 68000 still used?

After 43 years in production, the 68000 architecture is still in use.

What is 68K microprocessor?

The Motorola 68000 series (also known as 680x0, m68000, m68k, or 68k) is a family of 32-bit complex instruction set computer (CISC) microprocessors. During the 1980s and early 1990s, they were popular in personal computers and workstations and were the primary competitors of Intel's x86 microprocessors.

What is the 68000 assembly language?

68000 assembly is the assembly language used for the Motorola 68000, or commonly known as the 68K. It should not be confused with the 6800 (which predates it). The Motorola 68000 is a big-endian processor with full 32-bit capabilities (despite most systems that use it being considered 16-bit.)

How many General purpose registers are there in the MC68000 processor and what is the size of each?

As you know, the 68000 has a 32 bit Program Counter and 32 bit address registers. This is so because addresses of locations in memory are 32 bit numbers, and consequently you can address up to 232 locations, i.e. 232 bytes, or 4 gigabytes (each memory location is one byte).


1 Answers

I would recommend developing an operating system for the classic Amiga computers, which had different versions of the 68000 processor. Since the Amiga computer is a complete computer and is extremely well documented, I thought this would be a good exercise.

There is an emulator for it called UAE (and Win-UAE) which is very exact and can be configured with different kinds of processors (68000 - 68060) and other capabilities. Normally, you would also need to acquire ROMs for it, but since you are developing an operating system yourself, this is not necessary.

Tools you will need is either Cygwin (for developing under Windows) or a Linux computer. Then you will need cross compilers. This includes both a C compiler and an assembler. Here is a template for creating a simple ROM which changes screen color and flicks the power LED. It will create a file 'kick.rom' which UAE then searches for in the current directory.

Reference on the 68000 instruction set can be found at the links below. Be aware that different assembler programs may use slightly different syntax and instruction set.

If you need to demo the operating system on real hardware, there are modern Amiga clones sold on Ebay and other places. Search for "Minimig".

Update: Nowadays AROS also runs on UAE as well as physical Amigas.

Refs:

[UAE]
[WinUAE]
[Cygwin]
[Cross Compilers]
[68000 reference]

like image 74
Prof. Falken Avatar answered Oct 11 '22 00:10

Prof. Falken