为 Motorola 68K 处理器编写操作系统。我可以效仿吗?我可以测试操作系统开发吗?
下学期,我需要为 Motorola 68K 处理器编写一个基本操作系统,作为课程实验室材料的一部分。
是否有使用该处理器进行基本硬件设置的 Linux 模拟器?因此,我和我的合作伙伴可以在计算机上更快地进行调试,而无需重新启动电路板和其他东西。
是否可以将测试驱动开发技术应用到操作系统开发中?代码主要是汇编语言和 C 语言。尝试测试它的主要困难是什么?关于如何做有什么建议吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
我建议使用 QEMU 进行 m68k 仿真。
(您在 QEMU 中想要的系统模拟器是“Coldfire”——飞思卡尔称之为 m68k 架构的后继者)。
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).
你当然可以tdd这个项目。首先,通过简单的例程调用(例如 getch() 和 printf)解耦对硬件的所有访问,然后您可以提供简单的模拟来提供测试输入和检查输出。然后,您可以使用 gcc、msdev 或 xcode 在 PC 上编写超过 90% 的项目。一旦您对解耦例程有了一定的信心,您将需要很少的硬件访问权限,然后偶尔检查您的模拟是否按您的预期运行。
继续使用 C 直到找到特定的瓶颈,然后才求助于汇编程序。
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.
有一些使用硬件模拟 68000 CPU 的新项目,即 C-One 项目、Minimig (Mini Amiga) 项目和 Natami (Native Amiga) 项目 - 它们是新的 68k 兼容 Amiga 系统。
C One,可重新配置计算机,Minimig,正在开发中,原型已完成:FPGA Arcade 和 Natami。
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.
Easy68k http://www.easy68k.com 模拟器可能会帮助您。
The Easy68k http://www.easy68k.com simulator might help you.
uClinux 项目 是在 m68k 板上启动的。他们可能有您需要的工具...
The uClinux project started on a m68k board. They may have the tools you need...
我建议为经典 Amiga 计算机开发一个操作系统,该计算机具有不同版本的 68000 处理器。由于 Amiga 计算机是一台完整的计算机并且有非常完善的文档,我认为这将是一个很好的练习。
有一个名为 UAE(和 Win-UAE)的模拟器,非常精确且
可配置不同种类的处理器(68000 - 68060)和其他功能。通常,您还需要为其获取 ROM,但由于您是自己开发操作系统,因此没有必要。
您需要的工具是 Cygwin(用于在 Windows 下开发)或 Linux 计算机。然后你将需要交叉编译器。这包括 C 编译器和汇编器。 这里是一个模板,用于创建一个简单的 ROM,它可以更改屏幕颜色并闪烁电源 LED。它将创建一个文件“kick.rom”,然后 UAE 在当前目录中搜索该文件。
有关 68000 指令集的参考信息可以在下面的链接中找到。请注意,不同的汇编程序可能使用略有不同的语法和指令集。
如果您需要在真实硬件上演示操作系统,Ebay 和其他地方有出售现代 Amiga 克隆版。搜索“Minimig”。
更新:
如今 AROS 也可以在 UAE 和实体 Amigas 上运行。
参考文献:
[阿联酋]
[WinUAE]
[Cygwin]
[交叉编译器]
[68000 参考]
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]