Code Monkey home page Code Monkey logo

vidar's Introduction

vidar

my toy OS

30日でできる!OS自作入門 をやっていくレポジトリ

領域 概要
0x00007c00 ~ 0x00007dff ブートセクタ
0x00007e00 ~ 0x0009fc00 自由に使って良い
0x00008000 ~ 0x000081ff(512byte) ブートセクタの内容
0x00008200 ~ 0x00034fff(180KB) ファイルの内容
0x000a0000 ~ 0x000fffff ビデオメモリ

C0-H0-S1はブートセクタで,今の所,C0-H0-S1 ~ C9-H1-S18 が読み込まれる.

計180KBが読み込まれる. 18 * 10 * 2 * 512 = 184320 byte = 180KB

0x34fffまではファイルの内容が入っている.

0x34fff になる理由がよく分かってない. 0x08200 + 184320 = 0x35200 のはずで,どうやってその値が出てきたんだろう

ファイルの内容については,今の所10シリンダ分を読むようにしている.

0x4200にvidar.sysの内容がある. 0x8000 + 0x4200 = 0xc200 なので,0xc200 にジャンプすれば,vider.sys の内容を実行できる.

vidar.sys 実行前に, 0xff0 に,読み込んだシリンダ数を書き込むようにしてある.

0xff0 に保存している理由は,メモリマップを参照し,誰にも使われてなさそうだったから,ということらしい.

vidar's People

Contributors

musou1500 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

vidar's Issues

vidar.s を intel syntaxで書き直す

やろうとはしてみたけど,うまく動かず,原因がつかめてない.
今のところはAT&Tで書いているけど,原因の調査をやって他のものと統一したい.

rgb_table を静的変数にする

今は,色のリストをローカル変数で持っている.静的変数に直したい.

void init_palette(void)
{
  // staticにすると,色が正しく表示されないので,仕方なくローカル変数を使っている.
  // ブートのときに意図しない領域に書き込みを行っているのかもしれない
  unsigned char table_rgb[] = {
    0x00, 0x00, 0x00,	/*  0:黒 */
    0xff, 0x00, 0x00,	/*  1:明るい赤 */
    0x00, 0xff, 0x00,	/*  2:明るい緑 */
    0xff, 0xff, 0x00,	/*  3:明るい黄色 */
    0x00, 0x00, 0xff,	/*  4:明るい青 */
    0xff, 0x00, 0xff,	/*  5:明るい紫 */
    0x00, 0xff, 0xff,	/*  6:明るい水色 */
    0xff, 0xff, 0xff,	/*  7:白 */
    0xc6, 0xc6, 0xc6,	/*  8:明るい灰色 */
    0x84, 0x00, 0x00,	/*  9:暗い赤 */
    0x00, 0x84, 0x00,	/* 10:暗い緑 */
    0x84, 0x84, 0x00,	/* 11:暗い黄色 */
    0x00, 0x00, 0x84,	/* 12:暗い青 */
    0x84, 0x00, 0x84,	/* 13:暗い紫 */
    0x00, 0x84, 0x84,	/* 14:暗い水色 */
    0x84, 0x84, 0x84	/* 15:暗い灰色 */
  };

  ...
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.