The first day of the 30-day homemade operating system

Source: Internet
Author: User

At first, the author made a file full of binaries, which was created using Binary editor. The Software http://www.vcraft.jp/soft/bz.html

Of course, in my opinion, these binaries are meaningless because they are not readable at all.

But the author wants to let the reader know that the CPU is actually interpreting the binary instructions.

Attach the assembly code for the first day directly:

;Hello-os;tab=4;The following は standard なfat12フォーマットフロッピーディスクのためのdb 0xeb, 0x4e, 0x90 db"HELLOIPL"        ;ブートセクタの occupies いてよい (8バイト)Dw +                ;1セクタの da きさ (512にしなければいけない)Db1                ;クラスタの da きさ (1セクタにしなければいけない)Dw1                ;fatがどこから まるか (General は1セクタ からにする)Db2                ;fatの Number (2にしなければいけない)Dw224                ;ルートディレクトリ Big きさ (General は224エントリにする)Dw2880            ;このドライブの da きさ (2880セクタにしなければいけない)DB 0xf0;メディアのタイプ (0xf0にしなければいけない)Dw9                ;fat domain さを (9セクタにしなければいけない)Dw -                ;1トラックにいくつのセクタがあるか (18にしなければいけない)Dw2                ;number of ヘッドの (2にしなければいけない)Dd0                ;パーティションを make ってないのでここは must ず0Dd2880            ;このドライブ Big きさをもう once book BootcutDb0,0, 0x29;よくわからないけどこの にしておくといいらしいDD 0xFFFFFFFF;たぶんボリュームシリアル designationDb"Hello-os"    ;ディスクの name (11バイト)Db"FAT12"        ;フォーマットの name (8バイト)Resb -                ;とりあえず18バイトあけておく;プログラム Bodydb 0xb8, 0x00, 0x00, 0x8e, 0xd0, 0XBC, 0x00, 0x7c DB 0x8e, 0xd8, 0x8e, 0xc0, 0xBE, 0x74, 0x7c, 0x8a db 0x04, 0x83, 0xc6, 0x01, 0x3c, 0x00, 0x74, 0x09 DB 0xb4, 0x0e, 0xBB, 0x0f, 0x00, 0xCD, 0x10, 0xeb DB 0xEE, 0xf4, 0xeb, 0xfd;メッセージ PartDB 0x0a, 0x0a;diverted を2つDb"Hello, World"DB 0x0a;divertedDb0Resb 0x1fe-$;0x001feまでを0x00で buried める commandDB 0x55, 0xaa;The following はブートセクタ is a part of the statementDB 0xf0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 resb4600DB 0xf0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00 resb1469432

Without words, the key part of the code is still db 0x. This form. In other words, there is no difference in nature, just using the assembly statement such as rest XXXX Loop complex before so many 0.

Keep a record of some of the more useful information:

1 The first sector of a floppy disk is ScanDisk.

2 computer-readable floppy disks are read and written in 512-byte units, so a sector is 512 bytes.

31 floppy disks have a 1440kb,2880 sector.

4 The first sector is ScanDisk, IPL. Loaded with the operating system.

5 The end flag for the boot area is: 55AA

The first day of the 30-day homemade operating system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.