为Motorola 68K处理器编写操作系统。我可以效仿它吗?我可以试驾OS开发吗?

时间:2022-03-29 03:00:12

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

下一学期,我需要为Motorola 68K处理器编写基本操作系统,作为课程实验材料的一部分。

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.

是否有使用该处理器的基本硬件设置的Linux仿真器?所以我的合作伙伴和我可以在我们的计算机上更快地调试,而不是物理地重新启动电路板和东西。

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?

是否可以将测试驱动的开发技术应用于OS开发?代码主要是汇编和C.尝试试驾这个主要困难是什么?关于如何做的任何建议?

6 个解决方案

#1


5  

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.

你当然可以推荐这个项目。首先,通过简单的例程调用将所有对硬件的访问分离,例如, getch()和printf,然后你可以提供简单的模拟,提供测试输入和检查输出。然后,您可以使用gcc,msdev或xcode在PC上编写超过90%的项目。一旦你对解耦例程有了一些信心,你将需要很少的硬件访问权限,然后偶尔检查你的模拟是否按预期运行。

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

保持在C,直到找到一个特定的瓶颈,然后才使用汇编器。

#2


9  

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.

我建议为经典的Amiga计算机开发一个操作系统,它有68000处理器的不同版本。由于Amiga计算机是一台完整的计算机并且记录非常好,我认为这是一个很好的练习。

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.

它有一个名为UAE(和Win-UAE)的仿真器,非常精确,可以配置不同类型的处理器(68000 - 68060)和其他功能。通常,您还需要获取ROM,但由于您自己开发操作系统,因此没有必要。

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.

您需要的工具是Cygwin(用于在Windows下开发)或Linux计算机。那你需要交叉编译器。这包括C编译器和汇编器。这是一个用于创建简单ROM的模板,该ROM可以更改屏幕颜色并轻弹电源LED。它将创建一个文件'kick.rom',然后UAE在当前目录中搜索。

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.

有关68000指令集的参考信息,请参见以下链接。请注意,不同的汇编程序可能会使用略有不同的语法和指令集。

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".

如果您需要在真实硬件上演示操作系统,可以在Ebay和其他地方销售现代Amiga克隆。搜索“Minimig”。

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

更新:如今AROS还在阿联酋和物理Amigas上运行。

Refs:

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

[阿联酋] [WinUAE] [Cygwin] [交叉编译器] [68000参考]

#3


6  

I would suggest QEMU for m68k emulation.

我建议QEMU进行m68k仿真。

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

(你想在QEMU中使用的系统仿真器是“Coldfire” - 这就是飞思卡尔称之为m68k架构的继承者)。

#4


3  

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.

有一些新项目使用硬件模拟68000 cpus,C-One项目,Minimig(Mini Amiga)项目和Natami(Native Amiga)项目 - 它们是新的68k兼容Amiga系统。

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

C One,可重构计算机,Minimig,在开发中,原型完成:FPGA Arcade和Natami。

#5


3  

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

Easy68k http://www.easy68k.com模拟器可能对您有所帮助。

#6


1  

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

uClinux项目开始于m68k板。他们可能拥有你需要的工具......

#1


5  

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.

你当然可以推荐这个项目。首先,通过简单的例程调用将所有对硬件的访问分离,例如, getch()和printf,然后你可以提供简单的模拟,提供测试输入和检查输出。然后,您可以使用gcc,msdev或xcode在PC上编写超过90%的项目。一旦你对解耦例程有了一些信心,你将需要很少的硬件访问权限,然后偶尔检查你的模拟是否按预期运行。

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

保持在C,直到找到一个特定的瓶颈,然后才使用汇编器。

#2


9  

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.

我建议为经典的Amiga计算机开发一个操作系统,它有68000处理器的不同版本。由于Amiga计算机是一台完整的计算机并且记录非常好,我认为这是一个很好的练习。

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.

它有一个名为UAE(和Win-UAE)的仿真器,非常精确,可以配置不同类型的处理器(68000 - 68060)和其他功能。通常,您还需要获取ROM,但由于您自己开发操作系统,因此没有必要。

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.

您需要的工具是Cygwin(用于在Windows下开发)或Linux计算机。那你需要交叉编译器。这包括C编译器和汇编器。这是一个用于创建简单ROM的模板,该ROM可以更改屏幕颜色并轻弹电源LED。它将创建一个文件'kick.rom',然后UAE在当前目录中搜索。

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.

有关68000指令集的参考信息,请参见以下链接。请注意,不同的汇编程序可能会使用略有不同的语法和指令集。

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".

如果您需要在真实硬件上演示操作系统,可以在Ebay和其他地方销售现代Amiga克隆。搜索“Minimig”。

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

更新:如今AROS还在阿联酋和物理Amigas上运行。

Refs:

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

[阿联酋] [WinUAE] [Cygwin] [交叉编译器] [68000参考]

#3


6  

I would suggest QEMU for m68k emulation.

我建议QEMU进行m68k仿真。

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

(你想在QEMU中使用的系统仿真器是“Coldfire” - 这就是飞思卡尔称之为m68k架构的继承者)。

#4


3  

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.

有一些新项目使用硬件模拟68000 cpus,C-One项目,Minimig(Mini Amiga)项目和Natami(Native Amiga)项目 - 它们是新的68k兼容Amiga系统。

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

C One,可重构计算机,Minimig,在开发中,原型完成:FPGA Arcade和Natami。

#5


3  

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

Easy68k http://www.easy68k.com模拟器可能对您有所帮助。

#6


1  

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

uClinux项目开始于m68k板。他们可能拥有你需要的工具......