2020 New Year's gift - the development of an operating system from scratch

Preface

On the last day of 2019 finally completed the development of the whole system, and give it the name - Inios . Like the article name, written entirely from the kernel, non secondary development, from the initial "hello os" to have a system like the first time. Mainly written in C language, assembly language section. . The size of the entire operating system to complete 39.6 KBthe reason why so little is in fact the main reason for the language, another important reason is compressed on the part of the system code and font libraries and media in development. Among multiple iterations, the final completion of the development of the entire operating system Inios .

System Preview

The main development environment and tools

  • win 8.1 x64: Inios used to develop a "carrier"
  • qemu virtual machine: Testing Inios
  • wxmedit: 16 hex editor
  • nsak: Assembler
  • Notepad ++: code editor
  • Git: In addition to submit code, it is also used to generate special files

System functions

Command line terminal

  • mem: Display memory usage
  • cls: Empty the contents of the console
  • dir: To list
  • type: View the contents of the file
  • hlt: Run the executable program .hrb
  • shift+F1: Force programs to close
  • enter: Close the current application window
  • F11: The bottom of the window on top
  • Tab: Switching window
  • 鼠标点击: Switching window / moving window
  • shift+F2: Terminal Open / Open another terminal window (supported s)
  • exit: Close the current terminal window
  • ncst xx: A plurality of terminals can run programs

Protection System

Mainly to do with "Memory Access", "abnormal" and "Application DS segment address into the operating system used."

Multitasking

Commonly used multi-tasking, if a system can only run one program, then there is a lack of soul.

Text display

In the original basis, to achieve the Chinese display, use HZK16.fnt encoding library. Although a large font library, but after compression, or small half.

Mouse, keyboard control

An operating system commonly used functions, need to note is that during mouse control, using the mouse control is not easy now, probably changed the protocol, but the good news is that testing using the touchpad of the notebook, The effect is good.

Application window

Visualization window support program.

Media Player

Media here mainly refers to the "Audio", that is the audio, in fact, better to say "buzzer" to play good, because our music is to sound a "buzzer" in.

compression

采用的是作者自己做的压缩工具,前后权衡,既可以保证压缩率,也可保证解压速度——tek压缩。

图片预览

支持jpgbmp格式图片预览。

初始开发文档

起初是想这每天都会记录,记录包括但不限于开发中的bug及容易忽略的问题和技巧。但是由于时间原因只是写了5天的文档,后面的会后续补充。仔细想想这5天其实也足够了,其中包括开发中所需要的初始流程及工具的介绍和使用。如果您也想试着开发玩玩,不妨看下这个简单的文档。文档链接:说明文档.pdf

写在最后

至此文章写完,虽然每次都进行测试。但难免有所疏漏,如有有问题,欢迎指正,我将不胜感激。项目开源,如果您对此有着兴趣欢迎继续开发。如果可以的话,可以点一个一个star支持项目地址或点下推荐。这将是对我最大的鼓励,拳拳谢意,无以言表。

参考文献

  • 《汇编语言(第三版)王爽著》
  • 《操作系统设计与实现 上册 Andrew S.Tanenbaum 著》
  • 《30天自制操作系统 川合秀实 著》

Guess you like

Origin www.cnblogs.com/yjlaugus/p/12132585.html