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

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 19:01:51

You certainly can tdd this project. First off decouple all accesses to the hardware with simple routine calls, e.g. getch() and printf, then you can provide simple mocks that provide test input and check output. You can then write well over 90% of the project on a PC using gcc, msdev or xcode. Once you have got some confidence in the decoupling routines you will need very little access to the hardware, and only then to occasionally check that your mocks are acting as you expect.

Keep to C until you find a particular bottle neck, and only then resort to assembler.

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]

I would suggest QEMU for m68k emulation.

(The system emulator you want in QEMU is "Coldfire" - that's what Freescale calls the successor to the m68k architecture).

angelheart

There are a few new projects that use hardware simulated 68000 cpus, the C-One project, the Minimig (Mini Amiga) project and the Natami (Native Amiga) project - they are new 68k compatible Amiga systems.

C One, reconfigurable computer, Minimig, in development, prototypes done: FPGA Arcade and Natami.

The Easy68k http://www.easy68k.com simulator might help you.

The uClinux project started on a m68k board. They may have the tools you need...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!