os8088:为IBM PC/XT打造的类Mac图形操作系统
Os8088:为IBM XT/286/386打造的类Mac操作系统
os8088 1.0
os8088 1.0
A graphical operating system for the IBM PC/XT
适用于 IBM PC/XT 的图形操作系统
A Macintosh System 1-style desktop for the Intel 8086, written in real-mode assembly and booted from a floppy. Overlapping windows, pull-down menus, a serial mouse, loadable programs, and pre-emptive multitasking -- which the 1984 Macintosh did not have.
为 Intel 8086 设计的 Macintosh System 1 风格桌面,用实模式汇编编写,从软盘启动。支持重叠窗口、下拉菜单、串口鼠标、可加载程序以及抢占式多任务——这是 1984 年的 Macintosh 所不具备的。
in VGA, 16 colors
在 VGA 下,16 色
640x480
640x480
in Hercules, mono
在 Hercules 下,单色
720x348
720x348
in CGA, mono
在 CGA 下,单色
640x200
640x200
of RAM
内存
256K
256K
byte kernel
字节内核
80,486
80,486
pre-emption, 12 tasks
抢占式,12 个任务
18.2Hz
18.2Hz
Boot it in your browser Download the floppies Screenshots
在浏览器中启动它 下载软盘 截图
os8088
os8088
Five programs running at once. A Note Pad loaded off the software floppy, a ticking Clock, a bouncing ball, the Control Panel and the Task Manager, each a separate instance with its own dock tile. The Task Manager reports the machine at 70% busy and 147K of RAM in use.
同时运行五个程序。一个从软件软盘加载的记事本、一个走动的时钟、一个弹跳的球、控制面板和任务管理器,每个都是独立的实例,拥有自己的 dock 图标。任务管理器报告机器 70% 忙碌,内存使用 147K。
The desktop at rest, a few seconds after boot. The 512-byte boot sector has loaded the kernel and jumped to it. There is a floppy icon for each drive the machine reports through the BIOS, and the dock is empty because os8088 launches nothing at startup.
桌面静止状态,启动后几秒钟。512 字节的引导扇区已加载内核并跳转到它。每个 BIOS 报告的驱动器都有一个软盘图标,dock 为空,因为 os8088 启动时不启动任何程序。
A menu is open only while the button is held. Press in the menu bar, drag through the items, release on the one you want. There is no spare copy of the screen to restore from, so the pixels behind the pull-down are copied into a block claimed off the heap for exactly as long as the menu is up.
菜单仅在按住按钮时打开。在菜单栏中按下,拖动经过项目,在想要的项目上释放。没有备用屏幕副本可恢复,因此下拉菜单背后的像素被复制到从堆中分配的一个块中,只要菜单打开就保持。
A title-bar drag, caught halfway through. The window has not moved yet. A hollow one-pixel outline tracks the pointer in XOR mode, so erasing it is the identical operation to drawing it -- you can watch it invert the Disk window's own title text where it crosses.
标题栏拖动,中途捕捉。窗口尚未移动。一个空心的单像素轮廓以 XOR 模式跟踪指针,因此擦除它与绘制它是相同的操作——你可以看到它反转了 Disk 窗口自身的标题文本,当它交叉时。
Several instances of the same program. A Disk window, two Clocks and two Bounces, each a separate record in the instance table, each cascaded sixteen pixels down and right from the previous copy of its kind. Every instance gets a dock tile, and the tile's position is its table slot.
同一程序的多个实例。一个 Disk 窗口、两个 Clock 和两个 Bounce,每个都是实例表中的独立记录,每个都从同类的前一个副本向下和向右级联 16 像素。每个实例获得一个 dock 图标,图标的位置是其表槽。
Keystrokes reach the front window only. Two lines typed on the emulated keyboard, wrapped in the window's 258-pixel content area, with the caret after the last character. Each Note Pad instance gets its own 512-character buffer, and as many can be open at once as the heap has room for.
击键仅到达前台窗口。在模拟键盘上输入的两行文本,在窗口的 258 像素内容区域内换行,插入符在最后一个字符之后。每个记事本实例获得自己的 512 字符缓冲区,只要堆有空间,就可以同时打开任意多个。
The About box reads live kernel state. The word pre-emptive on the third line is rendered from the kernel's scheduler byte every time the box paints, so the About box, the Control Panel and the Task Manager cannot disagree about which scheduler is running.
关于框读取实时内核状态。第三行的“抢占式”一词每次绘制时都从内核的调度程序字节渲染,因此关于框、控制面板和任务管理器不可能对正在运行的调度程序产生分歧。
The Task Manager, with its history graph filled. One sample every nine ticks into a 160-column ring, so a full sweep across the window is about eighty seconds of history. Apps with no task of their own get their window callbacks timed at the dispatch site and billed to them, so the rows still add up to one total.
任务管理器,其历史图表已填满。每九个时钟周期采样一次,存入一个160列的环形缓冲区,因此横跨窗口的一次完整扫描大约代表八十秒的历史记录。没有自己任务的应用程序,其窗口回调会在调度点计时并计入它们名下,因此各行加起来仍等于总时间。
The scheduler setting, read straight from the kernel. The settings pane keeps no copy of the scheduler mode: it reads the kernel's mode byte every time it draws. Click Cooperative and the very next timer tick declines to switch tasks, with no restart and no handshake.
调度器设置,直接从内核读取。设置面板不保存调度器模式的副本:它每次绘制时都读取内核的模式字节。点击“协作式”,下一个时钟周期就会拒绝切换任务,无需重启,也无需握手。
Two of these five programs are minimized. Clock and Bounce were sent to the dock with the minimize box in their title bars, and their tiles draw inverted so you can see at a glance what is hidden. Minimized is not stopped -- the Clock is still counting, it only skips drawing.
这五个程序中有两个已最小化。Clock和Bounce通过标题栏中的最小化框发送到dock,它们的磁贴绘制为反色,以便您一眼看出哪些被隐藏了。最小化并不意味着停止——Clock仍在计数,只是跳过了绘制。
The file manager, reading the software floppy. The software disk mounted on drive B:, with each file's name, size and its own icon. The icons come off the disk itself -- the browser peeks each file's first sector, where a package carries its own 16x16 bitmap -- so the list shows a real icon without loading it.
文件管理器,正在读取软件软盘。软件磁盘挂载在B:驱动器上,每个文件都有名称、大小和其自己的图标。图标来自磁盘本身——浏览器会查看每个文件的第一个扇区,其中包含一个16x16的位图——因此列表显示真实图标而无需加载它。
Two loaded programs, each in its own segment. MINES and HELLO came off the same floppy into separate regions claimed off the heap -- 2,048 bytes and 512 -- and each runs at offset zero inside its own, so nothing had to be patched on the way in.
两个已加载的程序,各自位于自己的段中。MINES和HELLO来自同一张软盘,加载到从堆中分配的不同区域——2,048字节和512字节——并且每个都在其自己的段内从偏移零开始运行,因此无需在加载过程中进行修补。
Minesweeper: 1,510 bytes, loaded from the floppy. Double-clicking the MINES row read it into a segment of its own and opened its window; from then on its paint, key and click procs are plain near offsets the kernel calls exactly like a built-in's. This board is the only place in the system that uses more than two colors.
扫雷:1,510字节,从软盘加载。双击MINES行将其读入自己的段并打开其窗口;从那时起,其绘制、按键和点击过程就是普通的近偏移,内核像调用内置程序一样调用它们。这个棋盘是系统中唯一使用超过两种颜色的地方。
ArtfulType, a Markdown writer. ActionRetro's writing app for classic 68k Macintoshes, rebuilt for the 8086. Full-screen Writer mode with its own menu bar, styling as you type, and plain Markdown files that open anywhere else.
ArtfulType,一个Markdown写作工具。ActionRetro为经典68k Macintosh开发的写作应用,已为8086重建。全屏写作模式,带有自己的菜单栏,输入时即样式化,以及可在任何其他地方打开的纯Markdown文件。
Tracker, a four-channel MOD player. Load an Amiga .MOD off the floppy and play it: the pattern scrolls under the playing row, four channel meters move with the music, and the desktop stays usable while it plays.
Tracker,一个四通道MOD播放器。从软盘加载Amiga .MOD文件并播放:乐谱在播放行下滚动,四个通道电平表随音乐移动,播放时桌面仍可正常使用。
Paint, a bitmap editor. Pencil, eraser, fill, shapes, selection, eyedropper and text, with a resizable canvas, undo, a clipboard and sixteen colors. Reads and writes BMP and GIF.
Paint,一个位图编辑器。铅笔、橡皮擦、填充、形状、选择、取色器和文本,具有可调整大小的画布、撤销、剪贴板和十六种颜色。读写BMP和GIF格式。
Fractal, a Mandelbrot explorer. Zoom in, pick a color scheme, and watch the picture sharpen through three passes. It draws in the background, so the rest of the desktop keeps working while it renders.
分形,一个曼德博集合浏览器。放大,选择配色方案,观看图像通过三次渲染逐渐清晰。它在后台绘制,因此渲染时桌面的其余部分继续工作。
Piano, a two-octave keyboard. Play it with the mouse or the computer keys. Notes appear on the staff above as you play, and the staff plays back. Three built-in songs, and FM synthesis on a machine with a sound card.
钢琴,一个双八度键盘。用鼠标或电脑按键演奏。演奏时音符出现在上方的五线谱上,五线谱可以回放。内置三首歌曲,在有声卡的机器上支持FM合成。
Recorder, for sampled sound. Record, stop and play, with a waveform display and a built-in demo tone. It uses a Sound Blaster where the machine has one and the PC speaker where it does not; the status line says which.
录音机,用于采样声音。录制、停止和播放,带有波形显示和内置演示音调。在机器有声卡时使用Sound Blaster,否则使用PC扬声器;状态行会显示使用的是哪种。
Solitaire: Klondike. Deal from the stock, drag cards and runs between the seven columns, build the four foundations up from the aces. Cards drag with an outline, the same way windows do.
纸牌:克朗代克。从牌堆发牌,在七列之间拖动牌和牌列,从A开始构建四个基础牌堆。拖动牌时显示轮廓,与窗口拖动方式相同。
Arkanoid, a brick-breaker. Move the paddle with the arrow keys, clear six rows of bricks, keep the score across levels. The ball runs on its own timer, so it keeps a steady speed whatever else is happening.
打砖块,一个打砖游戏。用方向键移动挡板,清除六行砖块,跨关卡保持得分。球有自己的计时器,因此无论发生什么,它都保持稳定速度。
Minesweeper, on a 9x9 board with ten mines. Click a cell to open it, F for flag mode, N for a new game. Empty regions open in one click, and the first click is always safe -- the mines are laid after you have chosen where to start.
扫雷,在9x9的棋盘上有十颗地雷。点击单元格打开,F键切换标记模式,N键开始新游戏。空白区域一键打开,第一次点击总是安全的——地雷在你选择起始位置后才布置。
Note Pad, a plain text editor. Word wrap, a caret, and Open, Save and Save As through the system file dialog. It writes ordinary files onto the FAT12 floppy, so a note written here opens on a modern computer.
记事本,一个纯文本编辑器。自动换行,插入符,以及通过系统文件对话框进行打开、保存和另存为。它将普通文件写入FAT12软盘,因此在这里写的笔记可以在现代计算机上打开。
Hello: a window with two lines of text. It does nothing else. It ships as the smallest working example for anyone writing a program of their own, and as the only package with no icon, which is why the Disk window draws it with the generic one.
你好:一个包含两行文本的窗口。它不做其他任何事情。它作为编写自己程序的最小工作示例提供,也是唯一没有图标的软件包,这就是为什么磁盘窗口用通用图标绘制它的原因。
Back Pause Next
后退 暂停 下一步
What it is
它是什么
os8088 boots from the first sector of a floppy into a graphical desktop. There is no DOS underneath it and no command line anywhere in it -- the 512-byte boot sector loads a 40KB kernel, the kernel works out which display adapter the machine has and switches it into graphics, borrows the video card's own 8x8 character set, and puts up a menu bar.
os8088从软盘的第一扇区启动进入图形桌面。它下面没有DOS,也没有任何命令行——512字节的引导扇区加载40KB的内核,内核检测机器具有哪种显示适配器并将其切换到图形模式,借用显卡自己的8x8字符集,并显示菜单栏。
Everything after that is the interface you remember from a 1984 Macintosh: windows you drag by the title bar with a rubber-band outline, menus you pull down and drag through, a close box and a minimize box, icons for each floppy drive, and a dock along the bottom with one tile per running program. Programs load from a second floppy and run as first-class applications, several at a time.
之后的一切都是你记忆中的1984年Macintosh界面:通过标题栏拖动窗口并显示橡皮筋轮廓,下拉菜单并拖动选择,关闭框和最小化框,每个软盘驱动器的图标,以及底部停靠栏,每个运行的程序有一个图标。程序从第二张软盘加载,作为一等应用程序运行,可同时运行多个。
The whole thing fits in 256K of RAM on an Intel 8086 or 8088 -- the processor in the original IBM PC and PC/XT. It is a hobby project, finished enough to use. The source is real-mode NASM assembly, written with AI, and it is on GitHub.
整个项目在Intel 8086或8088处理器(即原始IBM PC和PC/XT中的处理器)的256K RAM中运行。这是一个爱好项目,已足够完善可供使用。源代码是实模式NASM汇编,由AI编写,并托管在GitHub上。
Video log
视频日志
Video log
视频日志
os8088 gets recorded as it is built -- one video per step, from the first boot into a desktop to loadable packages. They are all on the video log.
os8088在构建过程中被记录下来——每一步一个视频,从首次启动进入桌面到可加载的软件包。它们都在视频日志中。
By the numbers
数据一览
Every figure below comes from the build.
以下每个数字均来自构建过程。
更进一步:量化金融体系
看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力