From 294e6f0e3376e898b647ce58b31534ddb7025553 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Thu, 20 Feb 2025 15:52:42 +0000 Subject: [PATCH 01/41] created example lib for sake of testing --- Cargo.lock | 5 + Cargo.toml | 3 +- docs/.obsidian/app.json | 1 + docs/.obsidian/appearance.json | 1 + docs/.obsidian/core-plugins.json | 31 +++++ docs/.obsidian/graph.json | 22 ++++ docs/.obsidian/workspace.json | 198 ++++++++++++++++++++++++++++++ docs/Usage/Building The Kernel.md | 12 ++ kernel/Cargo.toml | 1 + kernel/src/main.rs | 4 + lib_example/Cargo.toml | 6 + lib_example/src/lib.rs | 5 + 12 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 docs/.obsidian/app.json create mode 100644 docs/.obsidian/appearance.json create mode 100644 docs/.obsidian/core-plugins.json create mode 100644 docs/.obsidian/graph.json create mode 100644 docs/.obsidian/workspace.json create mode 100644 docs/Usage/Building The Kernel.md create mode 100644 lib_example/Cargo.toml create mode 100644 lib_example/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index c5c8083..dc802d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,9 +12,14 @@ checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" name = "kernel" version = "0.1.0" dependencies = [ + "lib_example", "limine", ] +[[package]] +name = "lib_example" +version = "0.1.0" + [[package]] name = "limine" version = "0.3.1" diff --git a/Cargo.toml b/Cargo.toml index 3141e70..1d44ee7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] -members = [ +members = [ + "lib_example", "kernel" ] resolver = "2" diff --git a/docs/.obsidian/app.json b/docs/.obsidian/app.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/docs/.obsidian/app.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/docs/.obsidian/appearance.json b/docs/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/docs/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/docs/.obsidian/core-plugins.json b/docs/.obsidian/core-plugins.json new file mode 100644 index 0000000..b977c25 --- /dev/null +++ b/docs/.obsidian/core-plugins.json @@ -0,0 +1,31 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "webviewer": false +} \ No newline at end of file diff --git a/docs/.obsidian/graph.json b/docs/.obsidian/graph.json new file mode 100644 index 0000000..42a46ec --- /dev/null +++ b/docs/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 1, + "close": true +} \ No newline at end of file diff --git a/docs/.obsidian/workspace.json b/docs/.obsidian/workspace.json new file mode 100644 index 0000000..730b8e1 --- /dev/null +++ b/docs/.obsidian/workspace.json @@ -0,0 +1,198 @@ +{ + "main": { + "id": "20da7b1c0adc4114", + "type": "split", + "children": [ + { + "id": "a20540b7c1ddbfca", + "type": "tabs", + "children": [ + { + "id": "e1fb15cab546d0b6", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Usage/Building The Kernel.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "Building The Kernel" + } + } + ] + }, + { + "id": "6bf1f87bf81a3031", + "type": "tabs", + "children": [ + { + "id": "add883d295e04659", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "Usage/Building The Kernel.md", + "mode": "preview", + "source": false + }, + "icon": "lucide-file", + "title": "Building The Kernel" + } + } + ] + } + ], + "direction": "vertical" + }, + "left": { + "id": "8c92fa79437d4f31", + "type": "split", + "children": [ + { + "id": "e4a9f8318da249b0", + "type": "tabs", + "children": [ + { + "id": "da6fd2aac65f47f1", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": { + "sortOrder": "alphabetical", + "autoReveal": false + }, + "icon": "lucide-folder-closed", + "title": "Files" + } + }, + { + "id": "3f86b26f003a0d1a", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "tag:#usage", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + }, + "icon": "lucide-search", + "title": "Search" + } + }, + { + "id": "39755dd9db653e17", + "type": "leaf", + "state": { + "type": "bookmarks", + "state": {}, + "icon": "lucide-bookmark", + "title": "Bookmarks" + } + } + ] + } + ], + "direction": "horizontal", + "width": 200, + "collapsed": true + }, + "right": { + "id": "baa2a8e61b737fa6", + "type": "split", + "children": [ + { + "id": "b628e7116722c59a", + "type": "tabs", + "children": [ + { + "id": "eb1781be59af8c30", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "Usage/Building The Kernel.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-coming-in", + "title": "Backlinks for Building The Kernel" + } + }, + { + "id": "18e4602ee5825e11", + "type": "leaf", + "state": { + "type": "outgoing-link", + "state": { + "file": "Usage/Building The Kernel.md", + "linksCollapsed": false, + "unlinkedCollapsed": true + }, + "icon": "links-going-out", + "title": "Outgoing links from Building The Kernel" + } + }, + { + "id": "df5aadad9f62dff1", + "type": "leaf", + "state": { + "type": "tag", + "state": { + "sortOrder": "frequency", + "useHierarchy": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-tags", + "title": "Tags" + } + }, + { + "id": "9bc68cb074d39ab5", + "type": "leaf", + "state": { + "type": "outline", + "state": { + "file": "Usage/Building The Kernel.md", + "followCursor": false, + "showSearch": false, + "searchQuery": "" + }, + "icon": "lucide-list", + "title": "Outline of Building The Kernel" + } + } + ], + "currentTab": 2 + } + ], + "direction": "horizontal", + "width": 300 + }, + "left-ribbon": { + "hiddenItems": { + "switcher:Open quick switcher": false, + "graph:Open graph view": false, + "canvas:Create new canvas": false, + "daily-notes:Open today's daily note": false, + "templates:Insert template": false, + "command-palette:Open command palette": false + } + }, + "active": "e1fb15cab546d0b6", + "lastOpenFiles": [ + "Usage", + "Welcome.md", + "Usage/Building The Kernel.md" + ] +} \ No newline at end of file diff --git a/docs/Usage/Building The Kernel.md b/docs/Usage/Building The Kernel.md new file mode 100644 index 0000000..8de145e --- /dev/null +++ b/docs/Usage/Building The Kernel.md @@ -0,0 +1,12 @@ +#usage +### Requirements +- Latest rust nightly release +> rustup update +> rustup override set nightly +- Specific rustup components that can be installed with the following commands: +> rustup component add rust-src +> rustup component add llvm-tools-preview + +### Building +run the following command (in the root directory of the project) +> ./run.sh diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 2e813c9..8c855f6 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [dependencies] limine = "0.3.1" +lib_example = { path = "../lib_example" } [features] default = [] diff --git a/kernel/src/main.rs b/kernel/src/main.rs index a257fb9..ccf2a82 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -6,6 +6,8 @@ use core::arch::asm; use limine::request::{FramebufferRequest, RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; +use lib_example; + /// Sets the base revision to the latest revision supported by the crate. /// See specification for further info. /// Be sure to mark all limine requests with #[used], otherwise they may be removed by the compiler. @@ -32,6 +34,8 @@ unsafe extern "C" fn kmain() -> ! { // removed by the linker. assert!(BASE_REVISION.is_supported()); + lib_example::add_nums(1, 2); + if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { if let Some(framebuffer) = framebuffer_response.framebuffers().next() { for i in 0..100_u64 { diff --git a/lib_example/Cargo.toml b/lib_example/Cargo.toml new file mode 100644 index 0000000..4ea006a --- /dev/null +++ b/lib_example/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "lib_example" +version.workspace = true +edition.workspace = true + +[dependencies] diff --git a/lib_example/src/lib.rs b/lib_example/src/lib.rs new file mode 100644 index 0000000..1f8117c --- /dev/null +++ b/lib_example/src/lib.rs @@ -0,0 +1,5 @@ +#![no_std] + +pub fn add_nums(x: i32, y: i32) -> i32 { + x + y +} \ No newline at end of file From b028a97a44ea3bcbab77f1f5abf637f6f347da1c Mon Sep 17 00:00:00 2001 From: zxq5 Date: Thu, 20 Feb 2025 17:12:25 +0000 Subject: [PATCH 02/41] vscode workspace setup --- .idea/.gitignore | 8 ++++++++ .idea/FoundryOS.iml | 12 ++++++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 7 +++++++ 4 files changed, 35 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/FoundryOS.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/FoundryOS.iml b/.idea/FoundryOS.iml new file mode 100644 index 0000000..158aa3e --- /dev/null +++ b/.idea/FoundryOS.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e6c1e1c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..9bf7a27 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 60efcf39b6372053e719d6bc240be42b6a5cd806 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Thu, 20 Feb 2025 17:13:40 +0000 Subject: [PATCH 03/41] started setting up support for C code in the kernel --- .idea/.gitignore | 8 ++++++++ .idea/FoundryOS.iml | 12 ++++++++++++ .idea/modules.xml | 8 ++++++++ .idea/vcs.xml | 7 +++++++ Cargo.lock | 16 ++++++++++++++++ kernel/Cargo.toml | 5 ++++- kernel/build.rs | 7 ++++++- kernel/src/main.c | 3 +++ kernel/src/main.rs | 7 +++++++ 9 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/FoundryOS.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 kernel/src/main.c diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..13566b8 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/FoundryOS.iml b/.idea/FoundryOS.iml new file mode 100644 index 0000000..158aa3e --- /dev/null +++ b/.idea/FoundryOS.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e6c1e1c --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..9bf7a27 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index dc802d6..f059199 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,10 +8,20 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +[[package]] +name = "cc" +version = "1.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +dependencies = [ + "shlex", +] + [[package]] name = "kernel" version = "0.1.0" dependencies = [ + "cc", "lib_example", "limine", ] @@ -28,3 +38,9 @@ checksum = "9ca87cab008b8efeebdbe037cd4d1438037d48c5cb6fed939ffa5aa06315a321" dependencies = [ "bitflags", ] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 8c855f6..255736c 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -7,9 +7,12 @@ edition = "2021" limine = "0.3.1" lib_example = { path = "../lib_example" } +[build-dependencies] +cc = "1.2.14" + [features] default = [] [[bin]] name = "kernel" -path = "src/main.rs" \ No newline at end of file +path = "src/main.rs" diff --git a/kernel/build.rs b/kernel/build.rs index 4d43936..1ea5435 100644 --- a/kernel/build.rs +++ b/kernel/build.rs @@ -1,9 +1,14 @@ use std::process::Command; use std::{env, path::Path}; +use cc; fn main() { // Tell cargo to rerun if these files change println!("cargo:rerun-if-changed=src"); println!("cargo:rerun-if-changed=linker.ld"); println!("cargo:rerun-if-changed=../config/limine.conf"); -} + + cc::Build::new() + .file("src/main.c") + .compile("lib"); +} \ No newline at end of file diff --git a/kernel/src/main.c b/kernel/src/main.c new file mode 100644 index 0000000..af9b44a --- /dev/null +++ b/kernel/src/main.c @@ -0,0 +1,3 @@ +int add(int x, int y) { + return x+y; +} \ No newline at end of file diff --git a/kernel/src/main.rs b/kernel/src/main.rs index ccf2a82..d8832df 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -28,6 +28,11 @@ static _START_MARKER: RequestsStartMarker = RequestsStartMarker::new(); #[link_section = ".requests_end_marker"] static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new(); + +extern "C" { + pub fn add(x: i32, y: i32) -> i32; +} + #[no_mangle] unsafe extern "C" fn kmain() -> ! { // All limine requests must also be referenced in a called function, otherwise they may be @@ -35,6 +40,8 @@ unsafe extern "C" fn kmain() -> ! { assert!(BASE_REVISION.is_supported()); lib_example::add_nums(1, 2); + add(1, 2); + if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { if let Some(framebuffer) = framebuffer_response.framebuffers().next() { From 34b960c20ab3db0da08a7e0842e6f4f305e9cead Mon Sep 17 00:00:00 2001 From: zxq5 Date: Thu, 20 Feb 2025 22:59:24 +0000 Subject: [PATCH 04/41] println works --- .cargo/config.toml | 3 + Cargo.lock | 99 ++++++++- Cargo.toml | 4 +- kernel/Cargo.toml | 4 +- kernel/build.rs | 4 - kernel/src/main.c | 3 - kernel/src/main.rs | 58 ++--- lib/lib_ascii/Cargo.toml | 10 + lib/lib_ascii/src/font.rs | 200 ++++++++++++++++++ lib/lib_ascii/src/lib.rs | 199 +++++++++++++++++ .../lib_framebuffer}/Cargo.toml | 4 +- lib/lib_framebuffer/src/draw.rs | 57 +++++ lib/lib_framebuffer/src/lib.rs | 18 ++ lib/lib_serial/Cargo.toml | 10 + lib/lib_serial/src/io.rs | 23 ++ lib/lib_serial/src/lib.rs | 157 ++++++++++++++ lib_example/src/lib.rs | 5 - scripts/run.sh | 2 +- 18 files changed, 816 insertions(+), 44 deletions(-) delete mode 100644 kernel/src/main.c create mode 100644 lib/lib_ascii/Cargo.toml create mode 100644 lib/lib_ascii/src/font.rs create mode 100644 lib/lib_ascii/src/lib.rs rename {lib_example => lib/lib_framebuffer}/Cargo.toml (57%) create mode 100644 lib/lib_framebuffer/src/draw.rs create mode 100644 lib/lib_framebuffer/src/lib.rs create mode 100644 lib/lib_serial/Cargo.toml create mode 100644 lib/lib_serial/src/io.rs create mode 100644 lib/lib_serial/src/lib.rs delete mode 100644 lib_example/src/lib.rs diff --git a/.cargo/config.toml b/.cargo/config.toml index 973fadb..3b01eb5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -8,3 +8,6 @@ build-std-features = ["compiler-builtins-mem"] [env] RUST_TARGET_PATH = { value = "kernel", relative = true } + +[target.x86_64-kernel] +runner = "scripts/run.sh" \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index f059199..fc3b11b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,18 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + [[package]] name = "bitflags" version = "2.8.0" @@ -22,13 +34,47 @@ name = "kernel" version = "0.1.0" dependencies = [ "cc", - "lib_example", + "lib_ascii", + "lib_framebuffer", + "lib_serial", "limine", ] [[package]] -name = "lib_example" +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "lib_ascii" version = "0.1.0" +dependencies = [ + "lazy_static", + "lib_framebuffer", + "spin", + "x86_64", +] + +[[package]] +name = "lib_framebuffer" +version = "0.1.0" +dependencies = [ + "limine", + "spin", +] + +[[package]] +name = "lib_serial" +version = "0.1.0" +dependencies = [ + "lazy_static", + "spin", + "x86_64", +] [[package]] name = "limine" @@ -39,8 +85,57 @@ dependencies = [ "bitflags", ] +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "volatile" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442887c63f2c839b346c192d047a7c87e73d0689c9157b00b53dcc27dd5ea793" + +[[package]] +name = "x86_64" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f042214de98141e9c8706e8192b73f56494087cc55ebec28ce10f26c5c364ae" +dependencies = [ + "bit_field", + "bitflags", + "rustversion", + "volatile", +] diff --git a/Cargo.toml b/Cargo.toml index 1d44ee7..8b3748c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,8 @@ [workspace] members = [ - "lib_example", + "lib/lib_framebuffer", + "lib/lib_serial", + "lib/lib_ascii", "kernel" ] resolver = "2" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 255736c..d9d4087 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -5,7 +5,9 @@ edition = "2021" [dependencies] limine = "0.3.1" -lib_example = { path = "../lib_example" } +lib_framebuffer = { path = "../lib/lib_framebuffer" } +lib_serial = { path = "../lib/lib_serial" } +lib_ascii = { path = "../lib/lib_ascii" } [build-dependencies] cc = "1.2.14" diff --git a/kernel/build.rs b/kernel/build.rs index 1ea5435..a9b7914 100644 --- a/kernel/build.rs +++ b/kernel/build.rs @@ -7,8 +7,4 @@ fn main() { println!("cargo:rerun-if-changed=src"); println!("cargo:rerun-if-changed=linker.ld"); println!("cargo:rerun-if-changed=../config/limine.conf"); - - cc::Build::new() - .file("src/main.c") - .compile("lib"); } \ No newline at end of file diff --git a/kernel/src/main.c b/kernel/src/main.c deleted file mode 100644 index af9b44a..0000000 --- a/kernel/src/main.c +++ /dev/null @@ -1,3 +0,0 @@ -int add(int x, int y) { - return x+y; -} \ No newline at end of file diff --git a/kernel/src/main.rs b/kernel/src/main.rs index d8832df..c6ae3fc 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -3,10 +3,13 @@ use core::arch::asm; -use limine::request::{FramebufferRequest, RequestsEndMarker, RequestsStartMarker}; +use lib_serial::{serial_println, serial_read}; +use lib_ascii::{println, WRITER}; + +use limine::request::{RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; -use lib_example; +use lib_framebuffer; /// Sets the base revision to the latest revision supported by the crate. /// See specification for further info. @@ -16,10 +19,6 @@ use lib_example; #[link_section = ".requests"] static BASE_REVISION: BaseRevision = BaseRevision::new(); -#[used] -#[link_section = ".requests"] -static FRAMEBUFFER_REQUEST: FramebufferRequest = FramebufferRequest::new(); - /// Define the stand and end markers for Limine requests. #[used] #[link_section = ".requests_start_marker"] @@ -28,41 +27,48 @@ static _START_MARKER: RequestsStartMarker = RequestsStartMarker::new(); #[link_section = ".requests_end_marker"] static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new(); - -extern "C" { - pub fn add(x: i32, y: i32) -> i32; -} - #[no_mangle] unsafe extern "C" fn kmain() -> ! { // All limine requests must also be referenced in a called function, otherwise they may be // removed by the linker. assert!(BASE_REVISION.is_supported()); - lib_example::add_nums(1, 2); - add(1, 2); - - if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { - if let Some(framebuffer) = framebuffer_response.framebuffers().next() { - for i in 0..100_u64 { - // Calculate the pixel offset using the framebuffer information we obtained above. - // We skip `i` scanlines (pitch is provided in bytes) and add `i * 4` to skip `i` pixels forward. - let pixel_offset = i * framebuffer.pitch() + i * 4; - - // Write 0xFFFFFFFF to the provided pixel offset to fill it white. - *(framebuffer.addr().add(pixel_offset as usize) as *mut u32) = 0xFFFFFFFF; - } - } + if let Err(_) = lib_serial::init() { + loop {} } + let dimensions = lib_ascii::screensize_chars(); + let dimensions2 = lib_framebuffer::screensize_px(); + println!("Hello World!"); + println!("Dimensions: {}x{} (px)", dimensions2.0, dimensions2.1); + println!("Dimensions: {}x{} (chars)", dimensions.0, dimensions.1); + + println!(" + $$$$$$$$\\ $$\\ + $$ _____| $$ | + $$ | $$$$$$\\ $$\\ $$\\ $$$$$$$\\ $$$$$$$ | $$$$$$\\ $$\\ $$\\ + $$$$$\\ $$ __$$\\ $$ | $$ |$$ __$$\\ $$ __$$ |$$ __$$\\ $$ | $$ | + $$ __|$$ / $$ |$$ | $$ |$$ | $$ |$$ / $$ |$$ | \\__|$$ | $$ | + $$ | $$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ |$$ | $$ | $$ | + $$ | \\$$$$$$ |\\$$$$$$ |$$ | $$ |\\$$$$$$$ |$$ | \\$$$$$$$ | + \\__| \\______/ \\______/ \\__| \\__| \\_______|\\__| \\____$$ | + $$$$$$\\ $$$$$$\\ $$\\ $$\\ $$\\ $$\\ $$ | + $$ __$$\\ $$ __$$\\ $$ | $$ |$$$$ | \\$$$$$$ | + $$ / $$ |$$ / \\__| $$ | $$ |\\_$$ | \\______/ + $$ | $$ |\\$$$$$$\\ \\$$\\ $$ | $$ | + $$ | $$ | \\____$$\\ \\$$\\$$ / $$ | + $$ | $$ |$$\\ $$ | \\$$$ / $$ | + $$$$$$ |\\$$$$$$ | \\$ / $$$$$$\\ + \\______/ \\______/ \\_/ \\______| + "); + hcf(); } #[panic_handler] fn rust_panic(_info: &core::panic::PanicInfo) -> ! { hcf(); - // loop {} } fn hcf() -> ! { diff --git a/lib/lib_ascii/Cargo.toml b/lib/lib_ascii/Cargo.toml new file mode 100644 index 0000000..674cb7c --- /dev/null +++ b/lib/lib_ascii/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "lib_ascii" +version.workspace = true +edition.workspace = true + +[dependencies] +lazy_static = { version = "1.5.0", default-features = false, features = ["spin_no_std"] } +lib_framebuffer = { path = "../lib_framebuffer" } +spin = "0.9.8" +x86_64 = "0.15.2" diff --git a/lib/lib_ascii/src/font.rs b/lib/lib_ascii/src/font.rs new file mode 100644 index 0000000..0cd6ba4 --- /dev/null +++ b/lib/lib_ascii/src/font.rs @@ -0,0 +1,200 @@ +pub static FONT: [u8; 128 * 16] = [ + // ASCII 0-31 (Control Characters) - Using simple box patterns + // NUL (0) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // SOH (1) + 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // STX (2) + 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // ETX (3) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // EOT (4) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // ENQ (5) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // ACK (6) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // BEL (7) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, + // BS (8) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, + // HT (9) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, + // LF (10) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, + // VT (11) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, + // FF (12) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, + // CR (13) + 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, + // SO (14) + 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // SI (15) + 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // DLE (16) + 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // DC1 (17) + 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // DC2 (18) + 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // DC3 (19) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // DC4 (20) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // NAK (21) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // SYN (22) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + // ETB (23) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, + // CAN (24) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, + // EM (25) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, + // SUB (26) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, + // ESC (27) + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, + // FS (28) + 0x18, 0x3C, 0x7E, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, + // GS (29) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, + // RS (30) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0x18, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // US (31) + 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + // Space (32) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // ! (33) + 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + // " (34) + 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // # (35) + 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, + // $ (36) + 0x18, 0x18, 0x7C, 0xC6, 0xC2, 0xC0, 0x7C, 0x06, 0x86, 0xC6, 0x7C, 0x18, 0x18, 0x00, 0x00, 0x00, + // % (37) + 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC6, 0x0C, 0x18, 0x30, 0x60, 0xC6, 0x86, 0x00, 0x00, 0x00, 0x00, + // & (38) + 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, + // ' (39) + 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // ( (40) + 0x00, 0x00, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, + // ) (41) + 0x00, 0x00, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + // * (42) + 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // + (43) + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // , (44) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, + // - (45) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // . (46) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + // / (47) + 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, + // 0-9 (48-57) + 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xD6, 0xD6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0C, 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFE, 0xC0, 0xC0, 0xC0, 0xFC, 0x06, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x60, 0xC0, 0xC0, 0xFC, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFE, 0xC6, 0x06, 0x06, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x0C, 0x78, 0x00, 0x00, 0x00, 0x00, + // : (58) + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + // ; (59) + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, + // < (60) + 0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x00, + // = (61) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // > (62) + 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, + // ? (63) + 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x0C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + // @ (64) + 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xDE, 0xDE, 0xDE, 0xDC, 0xC0, 0x7C, 0x00, 0x00, 0x00, 0x00, + // A-Z (65-90) + 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0, 0xC0, 0xC2, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xDE, 0xC6, 0xC6, 0x66, 0x3A, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xDE, 0x7C, 0x0C, 0x0E, 0x00, 0x00, + 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x60, 0x38, 0x0C, 0x06, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7E, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xD6, 0xFE, 0xEE, 0x6C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x7C, 0x38, 0x38, 0x7C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFE, 0xC6, 0x86, 0x0C, 0x18, 0x30, 0x60, 0xC2, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, + // [ (91) + 0x00, 0x00, 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3C, 0x00, 0x00, 0x00, 0x00, + // \ (92) + 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, + // ] (93) + 0x00, 0x00, 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x3C, 0x00, 0x00, 0x00, 0x00, + // ^ (94) + 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // _ (95) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, + // ` (96) + 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // a-z (97-122) - lowercase letters + 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0x60, 0x60, 0x78, 0x6C, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1C, 0x0C, 0x0C, 0x3C, 0x6C, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0x60, 0x60, 0x6C, 0x76, 0x66, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x00, 0x0E, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0x60, 0x60, 0x66, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0xFE, 0xD6, 0xD6, 0xD6, 0xD6, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x76, 0x66, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x60, 0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x38, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xCC, 0x18, 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, + // { (123) + 0x00, 0x00, 0x0E, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0E, 0x00, 0x00, 0x00, 0x00, + // | (124) + 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, + // } (125) + 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, + // ~ (126) + 0x00, 0x00, 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + // DEL (127) + 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, +]; \ No newline at end of file diff --git a/lib/lib_ascii/src/lib.rs b/lib/lib_ascii/src/lib.rs new file mode 100644 index 0000000..584ed2e --- /dev/null +++ b/lib/lib_ascii/src/lib.rs @@ -0,0 +1,199 @@ +#![no_std] + +use core::fmt; +use lazy_static::lazy_static; +use spin::{Lazy, Mutex}; +use x86_64::instructions::interrupts; + +use lib_framebuffer::FRAMEBUFFER_WRITER; + +mod font; +use font::FONT; + +static FONT_WIDTH: u32 = 8; +static FONT_HEIGHT: u32 = 16; + +pub static WRITER: Lazy> = Lazy::new(|| Mutex::new(Writer::new())); + +pub fn screensize_chars() -> (u32, u32) { + let writer = WRITER.lock(); + (writer.screen_width, writer.screen_height) +} + +pub struct Writer { + // these are measured in chars NOT pixels + screen_width: u32, + screen_height: u32, + + text_line: u32, // 16 pixels tall + text_col: u32, // 8 pixels wide + + fg_color: u32, + bg_color: u32 +} + +impl Writer { + + pub fn new() -> Self { + if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { + Self { + screen_width: writer.width() as u32 / 8, + screen_height: writer.height() as u32 / 16, + text_line: 0, + text_col: 0, + fg_color: 0xFFFFFF, + bg_color: 0x000000 + } + } else { + panic!("Framebuffer writer not initialized"); + } + } + + pub fn write_char(&mut self, mut c: u8) { + if c == b'\n' { + self.newline(); + return; + } + + if c < 32 || c > 126 { + c = '?' as u8; + } + + // get the character data from the font array. -- each byte is a row of pixels + let data: &[u8] = &FONT[c as usize * 16..(c as usize + 1) * 16]; + + if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { + for row in 0..16 { + let line: u8 = data[row]; + for col in 0..8 { + let pixel_x: u32 = self.text_col * FONT_WIDTH + col; + let pixel_y: u32 = self.text_line * FONT_HEIGHT + row as u32; + + if line & (0x80 >> col) != 0 { + // write the foreground color + writer.write_pixel(pixel_x as usize, pixel_y as usize, self.fg_color); + } else { + // write the background color + writer.write_pixel(pixel_x as usize, pixel_y as usize, self.bg_color); + } + } + } + } + + // go to next position + if self.text_col + 1 >= self.screen_width { + self.newline(); + } else { + self.text_col += 1; + } + } + + pub fn dimensions(&self) -> (u32, u32) { + (self.screen_width, self.screen_height) + } + + pub fn next_char(&mut self) { + self.text_col += 1; + } + + pub fn newline(&mut self) { + self.text_col = 0; + + if self.text_line + 1 >= self.screen_height { + self.text_line = 0; + } else { + self.text_line += 1; + } + } + + pub fn write_string(&mut self, s: &str) { + for c in s.chars() { + self.write_char(c as u8); + } + } + + pub fn set_colour(&mut self, col: (u32, u32)) { + self.fg_color = col.0; + self.bg_color = col.1; + } + + pub fn reset_colour(&mut self) { + self.fg_color = 0xFFFFFF; + self.bg_color = 0x000000; + } +} + +impl core::fmt::Write for Writer { + fn write_str(&mut self, s: &str) -> core::fmt::Result { + self.write_string(s); + Ok(()) + } +} + +fn write(args: fmt::Arguments, fg_color: u32, bg_color: u32) { + use core::fmt::Write; + + interrupts::without_interrupts(|| { + let mut writer = WRITER.lock(); + writer.set_colour((fg_color, bg_color)); + writer.write_fmt(args).unwrap(); + writer.reset_colour(); + }); +} + +pub fn _print(args: fmt::Arguments) { + write(args, 0xFFFFFF, 0x000000); +} + +pub fn _printerr(args: fmt::Arguments) { + write(args, 0xFF8080, 0x000000); +} + +pub fn _log(args: fmt::Arguments) { + write(args, 0xFFFF00, 0x000000); +} + +pub fn clear_screen() { + interrupts::without_interrupts(|| { + let mut writer = WRITER.lock(); + writer.text_line = 0; + writer.text_col = 0; + + if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { + writer.clear(); + } + }); +} + +#[macro_export] +macro_rules! println_log { + () => ($crate::print_log!("\n")); + ($($arg:tt)*) => ($crate::print_log!("{}\n", format_args!($($arg)*))); +} + +#[macro_export] +macro_rules! print_log { + ($($arg:tt)*) => ($crate::_log(format_args!($($arg)*))); +} + +#[macro_export] +macro_rules! println { + () => ($crate::print!("\n")); + ($($arg:tt)*) => ($crate::print!("{}\n", format_args!($($arg)*))); +} + +#[macro_export] +macro_rules! print { + ($($arg:tt)*) => ($crate::_print(format_args!($($arg)*))); +} + +#[macro_export] +macro_rules! printlnerr { + () => ($crate::printerr!("\n")); + ($($arg:tt)*) => ($crate::printerr!("{}\n", format_args!($($arg)*))); +} + +#[macro_export] +macro_rules! printerr { + ($($arg:tt)*) => ($crate::_printerr(format_args!($($arg)*))); +} \ No newline at end of file diff --git a/lib_example/Cargo.toml b/lib/lib_framebuffer/Cargo.toml similarity index 57% rename from lib_example/Cargo.toml rename to lib/lib_framebuffer/Cargo.toml index 4ea006a..19737e4 100644 --- a/lib_example/Cargo.toml +++ b/lib/lib_framebuffer/Cargo.toml @@ -1,6 +1,8 @@ [package] -name = "lib_example" +name = "lib_framebuffer" version.workspace = true edition.workspace = true [dependencies] +limine = "0.3.1" +spin = "0.9.8" diff --git a/lib/lib_framebuffer/src/draw.rs b/lib/lib_framebuffer/src/draw.rs new file mode 100644 index 0000000..c2f0255 --- /dev/null +++ b/lib/lib_framebuffer/src/draw.rs @@ -0,0 +1,57 @@ +use core::panic; +use limine::framebuffer::Framebuffer; +use spin::{Mutex, Lazy}; + +use crate::FRAMEBUFFER_REQUEST; + +pub static FRAMEBUFFER_WRITER: Lazy>> = Lazy::new(|| Mutex::new( + if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { + let framebuffer = framebuffer_response.framebuffers().next().unwrap(); + Some(FramebufferWriter::new(framebuffer)) + } else { + panic!("Framebuffer request failed"); + } +)); + +pub struct FramebufferWriter<'a> { + framebuffer: Framebuffer<'a>, +} + +unsafe impl<'a> Send for FramebufferWriter<'a> {} +unsafe impl<'a> Sync for FramebufferWriter<'a> {} +impl<'a> FramebufferWriter<'a> { + pub fn new(framebuffer: Framebuffer<'a>) -> Self { + Self { + framebuffer, + } + } + + pub fn write_pixel(&self, x: usize, y: usize, color: u32) { + let pitch = self.framebuffer.pitch() as usize; + let bpp = (self.framebuffer.bpp() / 8) as usize; + let pixel_offset = y * pitch + x * bpp; + + unsafe { + *(self.framebuffer.addr().add(pixel_offset) as *mut u32) = color; + } + } + + pub fn width(&self) -> u32 { + self.framebuffer.width() as u32 + } + + pub fn height(&self) -> u32 { + self.framebuffer.height() as u32 + } + + pub fn clear(&self) { + let width = self.framebuffer.width() as usize; + let height = self.framebuffer.height() as usize; + + for y in 0..height { + for x in 0..width { + self.write_pixel(x, y, 0x000000); + } + } + } +} \ No newline at end of file diff --git a/lib/lib_framebuffer/src/lib.rs b/lib/lib_framebuffer/src/lib.rs new file mode 100644 index 0000000..61a28a3 --- /dev/null +++ b/lib/lib_framebuffer/src/lib.rs @@ -0,0 +1,18 @@ +#![no_std] + +use limine::request::FramebufferRequest; + +#[used] +#[link_section = ".requests"] +static FRAMEBUFFER_REQUEST: FramebufferRequest = FramebufferRequest::new(); + +mod draw; +pub use draw::FRAMEBUFFER_WRITER; + +pub fn screensize_px() -> (u32, u32) { + if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { + (writer.width(), writer.height()) + } else { + (0, 0) + } +} \ No newline at end of file diff --git a/lib/lib_serial/Cargo.toml b/lib/lib_serial/Cargo.toml new file mode 100644 index 0000000..fdd0427 --- /dev/null +++ b/lib/lib_serial/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "lib_serial" +version.workspace = true +edition.workspace = true + +[dependencies] +lazy_static = { version = "1.5.0", default-features = false, features = ["spin_no_std"] } +spin = "0.9.8" +x86_64 = "0.15.2" + diff --git a/lib/lib_serial/src/io.rs b/lib/lib_serial/src/io.rs new file mode 100644 index 0000000..994cbf0 --- /dev/null +++ b/lib/lib_serial/src/io.rs @@ -0,0 +1,23 @@ +use core::arch::asm; + +#[inline] +pub unsafe fn inb(port: u16) -> u8 { + let value: u8; + asm!( + "in al, dx", + out("al") value, + in("dx") port, + options(nomem, nostack, preserves_flags) + ); + value +} + +#[inline] +pub unsafe fn outb(port: u16, value: u8) { + asm!( + "out dx, al", + in("dx") port, + in("al") value, + options(nomem, nostack, preserves_flags) + ); +} \ No newline at end of file diff --git a/lib/lib_serial/src/lib.rs b/lib/lib_serial/src/lib.rs new file mode 100644 index 0000000..59fb98c --- /dev/null +++ b/lib/lib_serial/src/lib.rs @@ -0,0 +1,157 @@ +#![no_std] + +use core::{fmt, sync::atomic::{AtomicUsize, Ordering}}; +use spin::Mutex; +use lazy_static::lazy_static; + +mod io; +use io::*; +use x86_64::instructions::interrupts; + +static PORT: u16 = 0x3f8; +static mut BUFFER: [u8; 256] = [0; 256]; +static BUFFER_LEN: AtomicUsize = AtomicUsize::new(0); + +lazy_static!{ + static ref READER: Mutex> = Mutex::new(None); + static ref WRITER: Mutex> = Mutex::new(None); +} + +struct Reader; + +struct Writer; + +impl fmt::Write for Writer { + fn write_str(&mut self, s: &str) -> fmt::Result { + for c in s.chars() { + self.write_byte(c as u8); + } + Ok(()) + } +} + +impl Writer { + unsafe fn write_success(&self) -> bool { + inb(PORT + 5) & 0x20 != 0 + } + + pub fn write_byte(&self, data: u8) { unsafe { + while !self.write_success() {}; + outb(PORT + 0, data); + }} +} + + +pub fn init() -> Result<(), &'static str> { + if let Err(e) = test() { + return Err(e); + } + + if READER.lock().is_none() { + *READER.lock() = Some(Reader); + } + + if WRITER.lock().is_none() { + *WRITER.lock() = Some(Writer); + } + + Ok(()) +} + +pub fn test() -> Result<(), &'static str> { + unsafe { + outb(PORT + 1, 0x00); // Disable all interrupts + outb(PORT + 3, 0x80); // Enable DLAB (set baud rate divisor) + outb(PORT + 0, 0x03); // Set divisor to 3 (lo byte) 38400 baud + outb(PORT + 1, 0x00); // (hi byte) + outb(PORT + 3, 0x03); // 8 bits, no parity, one stop bit + outb(PORT + 2, 0xC7); // Enable FIFO, clear them, with 14-bytethreshold + outb(PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set + outb(PORT + 4, 0x1E); // Set in loopback mode, test the serial chip + outb(PORT + 0, 0xAE); // Test serial chip (send byte 0xAE and check if serial returns same byte) + + if inb(PORT + 0) != 0xAE { + return Err("serial test failed") + } + + outb(PORT + 4, 0x0F); + } + + Ok(()) +} + +impl Reader { + pub fn read_str_to_buffer(&mut self) { unsafe { + while !self.read_ready() {}; + + BUFFER_LEN.store(0, Ordering::SeqCst); + + while BUFFER_LEN.load(Ordering::SeqCst) < 256 { + let c = self.read(); + BUFFER[BUFFER_LEN.load(Ordering::SeqCst)] = c; + if c as char == '\r' { + break; + } + BUFFER_LEN.fetch_add(1, Ordering::SeqCst); + } + + serial_println!("returning") + }} + + unsafe fn read_ready(&self) -> bool { + inb(PORT + 5) & 1 != 0 + } + + pub fn read(&self) -> u8 { unsafe { + while !self.read_ready() {}; + return inb(PORT + 0); + }} +} + +pub fn _serial_write(args: fmt::Arguments) { + use core::fmt::Write; + + interrupts::without_interrupts(|| { + if let Some(writer) = WRITER.lock().as_mut() { + writer.write_fmt(args).unwrap(); + } + }) +} + +#[macro_export] +macro_rules! serial_println { + () => ($crate::serial_print!("\n")); + ($($arg:tt)*) => ($crate::serial_print!("{}\n", format_args!($($arg)*))); +} + +#[macro_export] +macro_rules! serial_print { + ($($arg:tt)*) => ($crate::_serial_write(format_args!($($arg)*))); +} + +pub fn serial_read() -> &'static str { + serial_println!("getting value!"); + + interrupts::without_interrupts(|| { + if let Some(reader) = READER.lock().as_mut() { + serial_println!("stuff happnin."); + reader.read_str_to_buffer(); + } else { + serial_println!("failed to get writer"); + } + }); + + serial_println!("eee"); + + let i = BUFFER_LEN.load(Ordering::SeqCst); + + return unsafe { + if i != 0 { + core::str::from_utf8(&BUFFER[..i - 1]).unwrap() + } else { + serial_println!("empty string"); + "" + } + } +} + diff --git a/lib_example/src/lib.rs b/lib_example/src/lib.rs deleted file mode 100644 index 1f8117c..0000000 --- a/lib_example/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![no_std] - -pub fn add_nums(x: i32, y: i32) -> i32 { - x + y -} \ No newline at end of file diff --git a/scripts/run.sh b/scripts/run.sh index 16a53c4..059a677 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -49,7 +49,7 @@ if [[ $1 == *"deps"* ]]; then else # Build the kernel normally cd "$project_root" - cargo build + # cargo build kernel_path="$build_dir/target/x86_64-kernel/debug/kernel" fi From e626a3bcf276311e18184efdba73f8d11e0296a6 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Fri, 21 Feb 2025 16:13:27 +0000 Subject: [PATCH 05/41] working on colour support --- docs/Usage/Building The Kernel.md | 1 - lib/lib_ascii/src/lib.rs | 8 +-- lib/lib_framebuffer/src/colour.rs | 51 ++++++++++++++++++++ lib/lib_framebuffer/src/draw.rs | 57 ---------------------- lib/lib_framebuffer/src/framebuffer.rs | 67 ++++++++++++++++++++++++++ lib/lib_framebuffer/src/lib.rs | 6 ++- scripts/run.sh | 26 +++++++--- 7 files changed, 145 insertions(+), 71 deletions(-) create mode 100644 lib/lib_framebuffer/src/colour.rs create mode 100644 lib/lib_framebuffer/src/framebuffer.rs diff --git a/docs/Usage/Building The Kernel.md b/docs/Usage/Building The Kernel.md index 8de145e..154f9f4 100644 --- a/docs/Usage/Building The Kernel.md +++ b/docs/Usage/Building The Kernel.md @@ -6,7 +6,6 @@ - Specific rustup components that can be installed with the following commands: > rustup component add rust-src > rustup component add llvm-tools-preview - ### Building run the following command (in the root directory of the project) > ./run.sh diff --git a/lib/lib_ascii/src/lib.rs b/lib/lib_ascii/src/lib.rs index 584ed2e..45cf5e3 100644 --- a/lib/lib_ascii/src/lib.rs +++ b/lib/lib_ascii/src/lib.rs @@ -5,7 +5,7 @@ use lazy_static::lazy_static; use spin::{Lazy, Mutex}; use x86_64::instructions::interrupts; -use lib_framebuffer::FRAMEBUFFER_WRITER; +use lib_framebuffer::{FRAMEBUFFER_WRITER, Color}; mod font; use font::FONT; @@ -15,6 +15,8 @@ static FONT_HEIGHT: u32 = 16; pub static WRITER: Lazy> = Lazy::new(|| Mutex::new(Writer::new())); + + pub fn screensize_chars() -> (u32, u32) { let writer = WRITER.lock(); (writer.screen_width, writer.screen_height) @@ -71,10 +73,10 @@ impl Writer { if line & (0x80 >> col) != 0 { // write the foreground color - writer.write_pixel(pixel_x as usize, pixel_y as usize, self.fg_color); + writer.write_pixel(pixel_x as usize, pixel_y as usize, Color::RGB(255, 0, 0)); } else { // write the background color - writer.write_pixel(pixel_x as usize, pixel_y as usize, self.bg_color); + writer.write_pixel(pixel_x as usize, pixel_y as usize, Color::HexARGB(self.bg_color)); } } } diff --git a/lib/lib_framebuffer/src/colour.rs b/lib/lib_framebuffer/src/colour.rs new file mode 100644 index 0000000..7477864 --- /dev/null +++ b/lib/lib_framebuffer/src/colour.rs @@ -0,0 +1,51 @@ +#[repr(u32)] +#[derive(Copy, Clone, PartialEq, Eq, Debug)] +pub enum Color { + ARGB(u8, u8, u8, u8), + RGB(u8, u8, u8), + HexARGB(u32), + Black = 0x000000FF, + Blue = 0x0000FFFF, + Green = 0x00FF00FF, + Cyan = 0x00FFFFFF, + Red = 0xFF0000FF, + Magenta = 0xFF00FFFF, + Yellow = 0xFFFF00FF, + White = 0xFFFFFFFF, +} + +impl Into for Color { + fn into(self) -> u32 { + match self { + Color::ARGB(a, r, g, b) => (a as u32) << 24 | (r as u32) << 16 | (g as u32) << 8 | (b as u32), + Color::RGB(r, g, b) => (0u32) << 24 | (r as u32) << 16 | (g as u32) << 8 | (b as u32), + Color::HexARGB(hex) => hex, + Color::Black => 0xFF000000, + Color::Blue => 0xFF0000FF, + Color::Green => 0xFF00FF00, + Color::Cyan => 0xFF00FFFF, + Color::Red => 0xFFFF0000, + Color::Magenta => 0xFFFF00FF, + Color::Yellow => 0xFFFFFF00, + Color::White => 0xFFFFFFFF, + } + } +} + +impl core::fmt::Display for Color { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Color::ARGB(r, g, b, a) => write!(f, "RGBA(#{:x}{:x}{:x}{:x})", r, g, b, a), + Color::RGB(r, g, b) => write!(f, "RGB(#{:x}{:x}{:x})", r, g, b), + Color::HexARGB(hex) => write!(f, "Hex(#{:x})", hex), + Color::Black => write!(f, "Black"), + Color::Blue => write!(f, "Blue"), + Color::Green => write!(f, "Green"), + Color::Cyan => write!(f, "Cyan"), + Color::Red => write!(f, "Red"), + Color::Magenta => write!(f, "Magenta"), + Color::Yellow => write!(f, "Yellow"), + Color::White => write!(f, "White"), + } + } +} \ No newline at end of file diff --git a/lib/lib_framebuffer/src/draw.rs b/lib/lib_framebuffer/src/draw.rs index c2f0255..e69de29 100644 --- a/lib/lib_framebuffer/src/draw.rs +++ b/lib/lib_framebuffer/src/draw.rs @@ -1,57 +0,0 @@ -use core::panic; -use limine::framebuffer::Framebuffer; -use spin::{Mutex, Lazy}; - -use crate::FRAMEBUFFER_REQUEST; - -pub static FRAMEBUFFER_WRITER: Lazy>> = Lazy::new(|| Mutex::new( - if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { - let framebuffer = framebuffer_response.framebuffers().next().unwrap(); - Some(FramebufferWriter::new(framebuffer)) - } else { - panic!("Framebuffer request failed"); - } -)); - -pub struct FramebufferWriter<'a> { - framebuffer: Framebuffer<'a>, -} - -unsafe impl<'a> Send for FramebufferWriter<'a> {} -unsafe impl<'a> Sync for FramebufferWriter<'a> {} -impl<'a> FramebufferWriter<'a> { - pub fn new(framebuffer: Framebuffer<'a>) -> Self { - Self { - framebuffer, - } - } - - pub fn write_pixel(&self, x: usize, y: usize, color: u32) { - let pitch = self.framebuffer.pitch() as usize; - let bpp = (self.framebuffer.bpp() / 8) as usize; - let pixel_offset = y * pitch + x * bpp; - - unsafe { - *(self.framebuffer.addr().add(pixel_offset) as *mut u32) = color; - } - } - - pub fn width(&self) -> u32 { - self.framebuffer.width() as u32 - } - - pub fn height(&self) -> u32 { - self.framebuffer.height() as u32 - } - - pub fn clear(&self) { - let width = self.framebuffer.width() as usize; - let height = self.framebuffer.height() as usize; - - for y in 0..height { - for x in 0..width { - self.write_pixel(x, y, 0x000000); - } - } - } -} \ No newline at end of file diff --git a/lib/lib_framebuffer/src/framebuffer.rs b/lib/lib_framebuffer/src/framebuffer.rs new file mode 100644 index 0000000..0d91287 --- /dev/null +++ b/lib/lib_framebuffer/src/framebuffer.rs @@ -0,0 +1,67 @@ +use core::panic; +use limine::framebuffer::Framebuffer; +use spin::{Mutex, Lazy}; + +use crate::{colour::Color, FRAMEBUFFER_REQUEST}; + +pub static FRAMEBUFFER_WRITER: Lazy>> = Lazy::new(|| Mutex::new( + if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { + let framebuffer = framebuffer_response.framebuffers().next().unwrap(); + Some(FramebufferWriter::new(framebuffer)) + } else { + panic!("Framebuffer request failed"); + } +)); + + + +pub struct FramebufferWriter<'a> { + framebuffer: Framebuffer<'a>, +} + +unsafe impl<'a> Send for FramebufferWriter<'a> {} +unsafe impl<'a> Sync for FramebufferWriter<'a> {} +impl<'a> FramebufferWriter<'a> { + pub fn new(framebuffer: Framebuffer<'a>) -> Self { + Self { + framebuffer, + } + } + + pub fn write_pixel(&self, x: usize, y: usize, color: Color) { + let pitch = self.framebuffer.pitch() as usize; + let bpp = (self.framebuffer.bpp() / 8) as usize; + let pixel_offset = y * pitch + x * bpp; + + unsafe { + *(self.framebuffer.addr().add(pixel_offset) as *mut u32) = color.into(); + } + } + + pub fn render_frame(&self, buffer: &[Color; 1280 * 800]) { + for (y, row) in buffer.chunks(1280).enumerate() { + for (x, pixel) in row.iter().enumerate() { + self.write_pixel(x, y, *pixel); + } + } + } + + pub fn width(&self) -> u32 { + self.framebuffer.width() as u32 + } + + pub fn height(&self) -> u32 { + self.framebuffer.height() as u32 + } + + pub fn clear(&self) { + let width = self.framebuffer.width() as usize; + let height = self.framebuffer.height() as usize; + + for y in 0..height { + for x in 0..width { + self.write_pixel(x, y, Color::Black); + } + } + } +} \ No newline at end of file diff --git a/lib/lib_framebuffer/src/lib.rs b/lib/lib_framebuffer/src/lib.rs index 61a28a3..5b16a7c 100644 --- a/lib/lib_framebuffer/src/lib.rs +++ b/lib/lib_framebuffer/src/lib.rs @@ -6,8 +6,10 @@ use limine::request::FramebufferRequest; #[link_section = ".requests"] static FRAMEBUFFER_REQUEST: FramebufferRequest = FramebufferRequest::new(); -mod draw; -pub use draw::FRAMEBUFFER_WRITER; +mod framebuffer; +mod colour; +pub use framebuffer::FRAMEBUFFER_WRITER; +pub use colour::Color; pub fn screensize_px() -> (u32, u32) { if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { diff --git a/scripts/run.sh b/scripts/run.sh index 059a677..2cf05ad 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -22,7 +22,7 @@ info() { } compiling() { - echo -e "${GREEN}${BOLD}Compiling${NC} $1" + echo -e "${GREEN}${BOLD}Compiling${NC}: $1" } warning() { @@ -30,7 +30,11 @@ warning() { } building() { - echo -e "${GREEN}${BOLD}Building${NC} $1" + echo -e "${GREEN}${BOLD}Building${NC}: $1" +} + +copying() { + echo -e "${GREEN}${BOLD} Copying${NC}: $1 to $2" } error() { @@ -38,6 +42,11 @@ error() { exit 1 } +copy_file() { + copying $1 $2 + cp "$1" "$2" || error $3 +} + build_dir="$project_root/build" iso_root="$build_dir/iso_root" @@ -83,12 +92,13 @@ fi # Copy files info "Copying files to ISO root" -cp -v "$kernel_path" "$iso_root/boot/kernel" || error "failed to copy kernel" -cp -v "$project_root/config/limine.conf" "$iso_root/boot/limine/limine.conf" || error "failed to copy limine config" -cp -v "$build_dir/limine/limine-bios.sys" "$build_dir/limine/limine-bios-cd.bin" \ - "$build_dir/limine/limine-uefi-cd.bin" "$iso_root/boot/limine/" || error "failed to copy limine files" -cp -v "$build_dir/limine/BOOTX64.EFI" "$iso_root/EFI/BOOT/" || error "failed to copy BOOTX64.EFI" -cp -v "$build_dir/limine/BOOTIA32.EFI" "$iso_root/EFI/BOOT/" || error "failed to copy BOOTIA32.EFI" +copy_file "$kernel_path" "$iso_root/boot/kernel" "failed to copy kernel" +copy_file "$project_root/config/limine.conf" "$iso_root/boot/limine/limine.conf" "failed to copy limine config" +copy_file "$build_dir/limine/limine-bios-cd.bin" "$iso_root/boot/limine/" "failed to copy limine-bios-cd.bin" +copy_file "$build_dir/limine/limine-uefi-cd.bin" "$iso_root/boot/limine/" "failed to copy limine-uefi-cd.bin" +copy_file "$build_dir/limine/limine-bios.sys" "$iso_root/boot/limine/" "failed to copy limine-bios.sys" +copy_file "$build_dir/limine/BOOTX64.EFI" "$iso_root/EFI/BOOT/" "failed to copy BOOTX64.EFI" +copy_file "$build_dir/limine/BOOTIA32.EFI" "$iso_root/EFI/BOOT/" "failed to copy BOOTIA32.EFI" # Create ISO building "bootable ISO image" From f0e25c7a5d8b6562c638b436474df35e59083635 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Fri, 21 Feb 2025 16:13:06 +0000 Subject: [PATCH 06/41] started work on lib_application - progress limited as requires alloc support to make further progress --- Cargo.lock | 7 +++++++ Cargo.toml | 2 +- kernel/src/main.rs | 6 +++++- lib/lib_application/Cargo.toml | 7 +++++++ lib/lib_application/src/application.rs | 10 ++++++++++ lib/lib_application/src/frame.rs | 0 lib/lib_application/src/lib.rs | 5 +++++ lib/lib_application/src/window.rs | 14 ++++++++++++++ lib/lib_ascii/src/font.rs | 3 +++ 9 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 lib/lib_application/Cargo.toml create mode 100644 lib/lib_application/src/application.rs create mode 100644 lib/lib_application/src/frame.rs create mode 100644 lib/lib_application/src/lib.rs create mode 100644 lib/lib_application/src/window.rs diff --git a/Cargo.lock b/Cargo.lock index fc3b11b..9dd5c5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,6 +49,13 @@ dependencies = [ "spin", ] +[[package]] +name = "lib_application" +version = "0.1.0" +dependencies = [ + "lib_ascii", +] + [[package]] name = "lib_ascii" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 8b3748c..0d17198 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = [ "lib/lib_serial", "lib/lib_ascii", "kernel" -] +, "lib/lib_application"] resolver = "2" [workspace.package] diff --git a/kernel/src/main.rs b/kernel/src/main.rs index c6ae3fc..9e619b3 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -4,7 +4,7 @@ use core::arch::asm; use lib_serial::{serial_println, serial_read}; -use lib_ascii::{println, WRITER}; +use lib_ascii::{print, println, WRITER}; use limine::request::{RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; @@ -63,6 +63,10 @@ unsafe extern "C" fn kmain() -> ! { \\______/ \\______/ \\_/ \\______| "); + for i in 0u8..128 { + print!("{}", i as char); + } + hcf(); } diff --git a/lib/lib_application/Cargo.toml b/lib/lib_application/Cargo.toml new file mode 100644 index 0000000..ef6aceb --- /dev/null +++ b/lib/lib_application/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "lib_application" +version.workspace = true +edition.workspace = true + +[dependencies] +lib_ascii = { path = "../lib_ascii" } diff --git a/lib/lib_application/src/application.rs b/lib/lib_application/src/application.rs new file mode 100644 index 0000000..285c09e --- /dev/null +++ b/lib/lib_application/src/application.rs @@ -0,0 +1,10 @@ + +pub trait Application { + fn run(&mut self, args: [&'static str; 5]) -> Result<(), Error>; +} + +pub enum Error { + OsError(&'static str), + ApplicationError(&'static str), +} + diff --git a/lib/lib_application/src/frame.rs b/lib/lib_application/src/frame.rs new file mode 100644 index 0000000..e69de29 diff --git a/lib/lib_application/src/lib.rs b/lib/lib_application/src/lib.rs new file mode 100644 index 0000000..e8d59dd --- /dev/null +++ b/lib/lib_application/src/lib.rs @@ -0,0 +1,5 @@ +#![no_std] + +pub mod application; +pub mod frame; +pub mod window; \ No newline at end of file diff --git a/lib/lib_application/src/window.rs b/lib/lib_application/src/window.rs new file mode 100644 index 0000000..1cecb3c --- /dev/null +++ b/lib/lib_application/src/window.rs @@ -0,0 +1,14 @@ + +pub struct Window { + width: usize, + height: usize +} + +impl Window { + pub fn new() -> Self { + Self { + width: 0, + height: 0 + } + } +} \ No newline at end of file diff --git a/lib/lib_ascii/src/font.rs b/lib/lib_ascii/src/font.rs index 0cd6ba4..be7a194 100644 --- a/lib/lib_ascii/src/font.rs +++ b/lib/lib_ascii/src/font.rs @@ -1,3 +1,6 @@ + + + pub static FONT: [u8; 128 * 16] = [ // ASCII 0-31 (Control Characters) - Using simple box patterns // NUL (0) From cc56dc807259387da6388f9f2090509ae76cb4f6 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 00:58:40 +0000 Subject: [PATCH 07/41] idk --- lib/lib_application/Cargo.toml | 7 - lib/lib_application/src/application.rs | 10 - lib/lib_application/src/frame.rs | 0 lib/lib_application/src/lib.rs | 5 - lib/lib_application/src/window.rs | 14 - lib/lib_ascii/src/font.rs | 491 +++++++++++++++---------- lib/lib_ascii/src/lib.rs | 54 +-- 7 files changed, 319 insertions(+), 262 deletions(-) delete mode 100644 lib/lib_application/Cargo.toml delete mode 100644 lib/lib_application/src/application.rs delete mode 100644 lib/lib_application/src/frame.rs delete mode 100644 lib/lib_application/src/lib.rs delete mode 100644 lib/lib_application/src/window.rs diff --git a/lib/lib_application/Cargo.toml b/lib/lib_application/Cargo.toml deleted file mode 100644 index ef6aceb..0000000 --- a/lib/lib_application/Cargo.toml +++ /dev/null @@ -1,7 +0,0 @@ -[package] -name = "lib_application" -version.workspace = true -edition.workspace = true - -[dependencies] -lib_ascii = { path = "../lib_ascii" } diff --git a/lib/lib_application/src/application.rs b/lib/lib_application/src/application.rs deleted file mode 100644 index 285c09e..0000000 --- a/lib/lib_application/src/application.rs +++ /dev/null @@ -1,10 +0,0 @@ - -pub trait Application { - fn run(&mut self, args: [&'static str; 5]) -> Result<(), Error>; -} - -pub enum Error { - OsError(&'static str), - ApplicationError(&'static str), -} - diff --git a/lib/lib_application/src/frame.rs b/lib/lib_application/src/frame.rs deleted file mode 100644 index e69de29..0000000 diff --git a/lib/lib_application/src/lib.rs b/lib/lib_application/src/lib.rs deleted file mode 100644 index e8d59dd..0000000 --- a/lib/lib_application/src/lib.rs +++ /dev/null @@ -1,5 +0,0 @@ -#![no_std] - -pub mod application; -pub mod frame; -pub mod window; \ No newline at end of file diff --git a/lib/lib_application/src/window.rs b/lib/lib_application/src/window.rs deleted file mode 100644 index 1cecb3c..0000000 --- a/lib/lib_application/src/window.rs +++ /dev/null @@ -1,14 +0,0 @@ - -pub struct Window { - width: usize, - height: usize -} - -impl Window { - pub fn new() -> Self { - Self { - width: 0, - height: 0 - } - } -} \ No newline at end of file diff --git a/lib/lib_ascii/src/font.rs b/lib/lib_ascii/src/font.rs index be7a194..94a37b8 100644 --- a/lib/lib_ascii/src/font.rs +++ b/lib/lib_ascii/src/font.rs @@ -1,203 +1,290 @@ - - - -pub static FONT: [u8; 128 * 16] = [ - // ASCII 0-31 (Control Characters) - Using simple box patterns - // NUL (0) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // SOH (1) - 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // STX (2) - 0x18, 0x3C, 0x7E, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // ETX (3) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // EOT (4) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // ENQ (5) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // ACK (6) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // BEL (7) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, - // BS (8) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, - // HT (9) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, - // LF (10) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, - // VT (11) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, - // FF (12) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, - // CR (13) - 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, - // SO (14) - 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // SI (15) - 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // DLE (16) - 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // DC1 (17) - 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // DC2 (18) - 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // DC3 (19) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // DC4 (20) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // NAK (21) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // SYN (22) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, - // ETB (23) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, 0xFF, - // CAN (24) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, 0xFF, - // EM (25) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, 0xFF, - // SUB (26) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0xFF, - // ESC (27) - 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, - // FS (28) - 0x18, 0x3C, 0x7E, 0xFF, 0x18, 0x18, 0x18, 0x18, 0x18, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, - // GS (29) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0x18, 0x18, 0x18, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, - // RS (30) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0x18, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // US (31) - 0x18, 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - // Space (32) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // ! (33) - 0x00, 0x00, 0x18, 0x3C, 0x3C, 0x3C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - // " (34) - 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // # (35) - 0x00, 0x00, 0x00, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x6C, 0xFE, 0x6C, 0x6C, 0x00, 0x00, 0x00, 0x00, - // $ (36) - 0x18, 0x18, 0x7C, 0xC6, 0xC2, 0xC0, 0x7C, 0x06, 0x86, 0xC6, 0x7C, 0x18, 0x18, 0x00, 0x00, 0x00, - // % (37) - 0x00, 0x00, 0x00, 0x00, 0xC2, 0xC6, 0x0C, 0x18, 0x30, 0x60, 0xC6, 0x86, 0x00, 0x00, 0x00, 0x00, - // & (38) - 0x00, 0x00, 0x38, 0x6C, 0x6C, 0x38, 0x76, 0xDC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, - // ' (39) - 0x00, 0x30, 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // ( (40) - 0x00, 0x00, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, - // ) (41) - 0x00, 0x00, 0x30, 0x18, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - // * (42) - 0x00, 0x00, 0x00, 0x00, 0x66, 0x3C, 0xFF, 0x3C, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // + (43) - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7E, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // , (44) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, - // - (45) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // . (46) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - // / (47) - 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, - // 0-9 (48-57) - 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xD6, 0xD6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7E, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x0C, 0x18, 0x30, 0x60, 0xC0, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7C, 0xC6, 0x06, 0x06, 0x3C, 0x06, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0C, 0x1C, 0x3C, 0x6C, 0xCC, 0xFE, 0x0C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFE, 0xC0, 0xC0, 0xC0, 0xFC, 0x06, 0x06, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x60, 0xC0, 0xC0, 0xFC, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFE, 0xC6, 0x06, 0x06, 0x0C, 0x18, 0x30, 0x30, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0x06, 0x06, 0x0C, 0x78, 0x00, 0x00, 0x00, 0x00, - // : (58) - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - // ; (59) - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, - // < (60) - 0x00, 0x00, 0x00, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x00, 0x00, 0x00, 0x00, - // = (61) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // > (62) - 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x0C, 0x06, 0x0C, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, - // ? (63) - 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x0C, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - // @ (64) - 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xDE, 0xDE, 0xDE, 0xDC, 0xC0, 0x7C, 0x00, 0x00, 0x00, 0x00, - // A-Z (65-90) - 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x66, 0x66, 0x66, 0x66, 0xFC, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xC0, 0xC0, 0xC2, 0x66, 0x3C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xF8, 0x6C, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x6C, 0xF8, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFE, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3C, 0x66, 0xC2, 0xC0, 0xC0, 0xDE, 0xC6, 0xC6, 0x66, 0x3A, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xFE, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1E, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xCC, 0xCC, 0xCC, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE6, 0x66, 0x6C, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xF0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xFE, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC6, 0xEE, 0xFE, 0xFE, 0xD6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC6, 0xE6, 0xF6, 0xFE, 0xDE, 0xCE, 0xC6, 0xC6, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xDE, 0x7C, 0x0C, 0x0E, 0x00, 0x00, - 0x00, 0x00, 0xFC, 0x66, 0x66, 0x66, 0x7C, 0x6C, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0x60, 0x38, 0x0C, 0x06, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7E, 0x7E, 0x5A, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x6C, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xD6, 0xFE, 0xEE, 0x6C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xC6, 0xC6, 0x6C, 0x7C, 0x38, 0x38, 0x7C, 0x6C, 0xC6, 0xC6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xFE, 0xC6, 0x86, 0x0C, 0x18, 0x30, 0x60, 0xC2, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, - // [ (91) - 0x00, 0x00, 0x3C, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x3C, 0x00, 0x00, 0x00, 0x00, - // \ (92) - 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x38, 0x1C, 0x0E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, - // ] (93) - 0x00, 0x00, 0x3C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x3C, 0x00, 0x00, 0x00, 0x00, - // ^ (94) - 0x10, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // _ (95) - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, - // ` (96) - 0x30, 0x18, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // a-z (97-122) - lowercase letters - 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0C, 0x7C, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0x60, 0x60, 0x78, 0x6C, 0x66, 0x66, 0x66, 0x66, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC0, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1C, 0x0C, 0x0C, 0x3C, 0x6C, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xFE, 0xC0, 0xC0, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x6C, 0x64, 0x60, 0xF0, 0x60, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0xCC, 0x78, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0x60, 0x60, 0x6C, 0x76, 0x66, 0x66, 0x66, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x06, 0x00, 0x0E, 0x06, 0x06, 0x06, 0x06, 0x66, 0x66, 0x3C, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xE0, 0x60, 0x60, 0x66, 0x6C, 0x78, 0x78, 0x6C, 0x66, 0xE6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0xFE, 0xD6, 0xD6, 0xD6, 0xD6, 0xC6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0xC6, 0xC6, 0xC6, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x66, 0x66, 0x66, 0x7C, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xCC, 0xCC, 0xCC, 0x7C, 0x0C, 0x0C, 0x1E, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x76, 0x66, 0x60, 0x60, 0x60, 0xF0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7C, 0xC6, 0x60, 0x38, 0x0C, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x30, 0x30, 0xFC, 0x30, 0x30, 0x30, 0x30, 0x36, 0x1C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3C, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xD6, 0xD6, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x6C, 0x38, 0x38, 0x38, 0x6C, 0xC6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xC6, 0xC6, 0xC6, 0xC6, 0x7E, 0x06, 0xC6, 0x7C, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0xCC, 0x18, 0x30, 0x60, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, - // { (123) - 0x00, 0x00, 0x0E, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0E, 0x00, 0x00, 0x00, 0x00, - // | (124) - 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, - // } (125) - 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, 0x0E, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, - // ~ (126) - 0x00, 0x00, 0x76, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - // DEL (127) - 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6C, 0xC6, 0xC6, 0xC6, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, +pub static FONT: [u8; 288 * 16] = [ + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0 + 0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00, // 1 + 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, // 2 + 0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, // 3 + 0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00, // 4 + 0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 5 + 0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 6 + 0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 7 + 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 8 + 0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff, // 9 + 0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00, // 10 + 0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff, // 11 + 0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, // 12 + 0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, // 13 + 0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00, // 14 + 0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00, // 15 + 0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00, // 16 + 0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, // 17 + 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00, // 18 + 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 19 + 0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00, // 20 + 0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00, // 21 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00, // 22 + 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, // 23 + 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 24 + 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00, // 25 + 0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 26 + 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 27 + 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, // 28 + 0x00,0x00,0x00,0x00,0x00,0x28,0x6c,0xfe,0x6c,0x28,0x00,0x00,0x00,0x00,0x00,0x00, // 29 + 0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00, // 30 + 0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 31 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32 + 0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // 33 + 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 34 + 0x00,0x00,0x00,0x6c,0x6c,0xfe,0x6c,0x6c,0x6c,0xfe,0x6c,0x6c,0x00,0x00,0x00,0x00, // 35 + 0x18,0x18,0x7c,0xc6,0xc2,0xc0,0x7c,0x06,0x06,0x86,0xc6,0x7c,0x18,0x18,0x00,0x00, // 36 + 0x00,0x00,0x00,0x00,0xc2,0xc6,0x0c,0x18,0x30,0x60,0xc6,0x86,0x00,0x00,0x00,0x00, // 37 + 0x00,0x00,0x38,0x6c,0x6c,0x38,0x76,0xdc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 38 + 0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 39 + 0x00,0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00,0x00, // 40 + 0x00,0x00,0x30,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00,0x00, // 41 + 0x00,0x00,0x00,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00, // 42 + 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 43 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, // 44 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 45 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // 46 + 0x00,0x00,0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,0x00,0x00, // 47 + 0x00,0x00,0x38,0x6c,0xc6,0xc6,0xd6,0xd6,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00, // 48 + 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00, // 49 + 0x00,0x00,0x7c,0xc6,0x06,0x0c,0x18,0x30,0x60,0xc0,0xc6,0xfe,0x00,0x00,0x00,0x00, // 50 + 0x00,0x00,0x7c,0xc6,0x06,0x06,0x3c,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, // 51 + 0x00,0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, // 52 + 0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xfc,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, // 53 + 0x00,0x00,0x38,0x60,0xc0,0xc0,0xfc,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 54 + 0x00,0x00,0xfe,0xc6,0x06,0x06,0x0c,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // 55 + 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7c,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 56 + 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x0c,0x78,0x00,0x00,0x00,0x00, // 57 + 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // 58 + 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, // 59 + 0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00, // 60 + 0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 61 + 0x00,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00,0x00, // 62 + 0x00,0x00,0x7c,0xc6,0xc6,0x0c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // 63 + 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x00,0x00, // 64 + 0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 65 + 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00, // 66 + 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00, // 67 + 0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,0x00,0x00, // 68 + 0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, // 69 + 0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 70 + 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xde,0xc6,0xc6,0x66,0x3a,0x00,0x00,0x00,0x00, // 71 + 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 72 + 0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 73 + 0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, // 74 + 0x00,0x00,0xe6,0x66,0x66,0x6c,0x78,0x78,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, // 75 + 0x00,0x00,0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, // 76 + 0x00,0x00,0xc6,0xee,0xfe,0xfe,0xd6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 77 + 0x00,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 78 + 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 79 + 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 80 + 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xd6,0xde,0x7c,0x0c,0x0e,0x00,0x00, // 81 + 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, // 82 + 0x00,0x00,0x7c,0xc6,0xc6,0x60,0x38,0x0c,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 83 + 0x00,0x00,0x7e,0x7e,0x5a,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 84 + 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 85 + 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x10,0x00,0x00,0x00,0x00, // 86 + 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xd6,0xd6,0xd6,0xfe,0xee,0x6c,0x00,0x00,0x00,0x00, // 87 + 0x00,0x00,0xc6,0xc6,0x6c,0x7c,0x38,0x38,0x7c,0x6c,0xc6,0xc6,0x00,0x00,0x00,0x00, // 88 + 0x00,0x00,0x66,0x66,0x66,0x66,0x3c,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 89 + 0x00,0x00,0xfe,0xc6,0x86,0x0c,0x18,0x30,0x60,0xc2,0xc6,0xfe,0x00,0x00,0x00,0x00, // 90 + 0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00,0x00, // 91 + 0x00,0x00,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, // 92 + 0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00,0x00, // 93 + 0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 94 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00, // 95 + 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 96 + 0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 97 + 0x00,0x00,0xe0,0x60,0x60,0x78,0x6c,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00, // 98 + 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 99 + 0x00,0x00,0x1c,0x0c,0x0c,0x3c,0x6c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 100 + 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 101 + 0x00,0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 102 + 0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0xcc,0x78,0x00, // 103 + 0x00,0x00,0xe0,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, // 104 + 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 105 + 0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00, // 106 + 0x00,0x00,0xe0,0x60,0x60,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00, // 107 + 0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 108 + 0x00,0x00,0x00,0x00,0x00,0xec,0xfe,0xd6,0xd6,0xd6,0xd6,0xc6,0x00,0x00,0x00,0x00, // 109 + 0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 110 + 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 111 + 0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00, // 112 + 0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1e,0x00, // 113 + 0x00,0x00,0x00,0x00,0x00,0xdc,0x76,0x66,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 114 + 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x60,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,0x00, // 115 + 0x00,0x00,0x10,0x30,0x30,0xfc,0x30,0x30,0x30,0x30,0x36,0x1c,0x00,0x00,0x00,0x00, // 116 + 0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 117 + 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00,0x00,0x00,0x00, // 118 + 0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xd6,0xd6,0xd6,0xfe,0x6c,0x00,0x00,0x00,0x00, // 119 + 0x00,0x00,0x00,0x00,0x00,0xc6,0x6c,0x38,0x38,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00, // 120 + 0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0xf8,0x00, // 121 + 0x00,0x00,0x00,0x00,0x00,0xfe,0xcc,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, // 122 + 0x00,0x00,0x0e,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0e,0x00,0x00,0x00,0x00, // 123 + 0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 124 + 0x00,0x00,0x70,0x18,0x18,0x18,0x0e,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, // 125 + 0x00,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 126 + 0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00, // 127 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 128 + 0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3c,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00, // 129 + 0x00,0x18,0x18,0x3c,0x66,0x60,0x60,0x60,0x66,0x3c,0x18,0x18,0x00,0x00,0x00,0x00, // 130 + 0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xe6,0xfc,0x00,0x00,0x00,0x00, // 131 + 0x00,0x00,0x66,0x66,0x3c,0x18,0x7e,0x18,0x7e,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 132 + 0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00, // 133 + 0x00,0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 134 + 0x00,0x00,0x00,0x00,0x00,0x36,0x6c,0xd8,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00, // 135 + 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, // 136 + 0x00,0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 137 + 0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0xff,0x00,0x00,0x00,0x00, // 138 + 0x00,0x70,0xd8,0x30,0x60,0xc8,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 139 + 0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xc0,0x00,0x00,0x00, // 140 + 0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00, // 141 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 142 + 0x00,0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 143 + 0x00,0x00,0x00,0x00,0x00,0xd8,0x6c,0x36,0x6c,0xd8,0x00,0x00,0x00,0x00,0x00,0x00, // 144 + 0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x66,0xce,0x9e,0x3e,0x06,0x06,0x00,0x00, // 145 + 0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x60,0xdc,0x86,0x0c,0x18,0x3e,0x00,0x00, // 146 + 0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xc0,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 147 + 0x00,0xc6,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 148 + 0x38,0x6c,0x38,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 149 + 0x00,0x00,0x3e,0x6c,0xcc,0xcc,0xfe,0xcc,0xcc,0xcc,0xcc,0xce,0x00,0x00,0x00,0x00, // 150 + 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x0c,0x06,0x7c,0x00,0x00, // 151 + 0x18,0x30,0x60,0x00,0xfe,0x66,0x60,0x7c,0x60,0x60,0x66,0xfe,0x00,0x00,0x00,0x00, // 152 + 0x76,0xdc,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 153 + 0x00,0xc6,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 154 + 0x00,0xc6,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 155 + 0x00,0x00,0x78,0xcc,0xcc,0xcc,0xd8,0xcc,0xc6,0xc6,0xc6,0xcc,0x00,0x00,0x00,0x00, // 156 + 0x00,0x60,0x30,0x18,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 157 + 0x00,0x18,0x30,0x60,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 158 + 0x00,0x10,0x38,0x6c,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 159 + 0x00,0x00,0xcc,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 160 + 0x00,0x38,0x6c,0x38,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 161 + 0x00,0x00,0x00,0x00,0x00,0xcc,0x76,0x36,0x7e,0xd8,0xd8,0x6e,0x00,0x00,0x00,0x00, // 162 + 0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x66,0x3c,0x0c,0x06,0x3c,0x00,0x00,0x00, // 163 + 0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 164 + 0x00,0x0c,0x18,0x30,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 165 + 0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 166 + 0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 167 + 0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 168 + 0x00,0x0c,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 169 + 0x00,0x18,0x3c,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 170 + 0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 171 + 0x00,0x00,0x76,0xdc,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 172 + 0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 173 + 0x00,0x18,0x30,0x60,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 174 + 0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 175 + 0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 176 + 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7e,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // 177 + 0x00,0x60,0x30,0x18,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 178 + 0x00,0x18,0x30,0x60,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 179 + 0x00,0x30,0x78,0xcc,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 180 + 0x00,0x00,0xcc,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 181 + 0x00,0x00,0xc6,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0x78,0x00, // 182 + 0x00,0x0e,0x1b,0x18,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0x18,0xd8,0x70,0x00,0x00, // 183 + 0x00,0x00,0xfe,0xc6,0xc6,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00, // 184 + 0x00,0x00,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00, // 185 + 0x00,0x00,0x00,0xfe,0xc6,0x60,0x30,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, // 186 + 0x00,0x00,0x00,0x7e,0x18,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, // 187 + 0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0x6c,0x6c,0x6c,0x6c,0xee,0x00,0x00,0x00,0x00, // 188 + 0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0xd8,0xd8,0xd8,0xdc,0x76,0x00,0x00,0x00,0x00, // 189 + 0x00,0x00,0x1e,0x30,0x18,0x0c,0x3e,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00, // 190 + 0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x60,0x60,0x60,0x30,0x1c,0x00,0x00,0x00,0x00, // 191 + 0x00,0x00,0x00,0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00, // 192 + 0x00,0x00,0x00,0x00,0x00,0x7e,0xd8,0xd8,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, // 193 + 0x00,0x00,0x00,0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 194 + 0x00,0x00,0x00,0x03,0x06,0x7e,0xdb,0xdb,0xf3,0x7e,0x60,0xc0,0x00,0x00,0x00,0x00, // 195 + 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 196 + 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 197 + 0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 198 + 0x00,0xf8,0xcc,0xcc,0xf8,0xc4,0xcc,0xde,0xcc,0xcc,0xcc,0xc6,0x00,0x00,0x00,0x00, // 199 + 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 200 + 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 201 + 0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 202 + 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00, // 203 + 0x00,0x00,0x00,0x00,0x00,0x28,0x6c,0xfe,0x6c,0x28,0x00,0x00,0x00,0x00,0x00,0x00, // 204 + 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00, // 205 + 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, // 206 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 207 + 0x00,0x0f,0x0c,0x0c,0x0c,0x0c,0x0c,0xec,0x6c,0x6c,0x3c,0x1c,0x00,0x00,0x00,0x00, // 208 + 0x00,0x00,0x00,0x00,0x00,0x7e,0xdb,0xdb,0xdb,0x7e,0x00,0x00,0x00,0x00,0x00,0x00, // 209 + 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, // 210 + 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 211 + 0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00, // 212 + 0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, // 213 + 0x00,0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x7e,0x00,0x00,0x00,0x00, // 214 + 0x00,0x00,0x00,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x7e,0x00,0x00,0x00,0x00, // 215 + 0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00, // 216 + 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,0x00, // 217 + 0x00,0x00,0x0e,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 218 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, // 219 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 220 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 221 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 222 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 223 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 224 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 225 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 226 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 227 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 228 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 229 + 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 230 + 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 231 + 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 232 + 0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 233 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 234 + 0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 235 + 0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 236 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 237 + 0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 238 + 0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 239 + 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 240 + 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 241 + 0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 242 + 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 243 + 0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 244 + 0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 245 + 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 246 + 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 247 + 0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 248 + 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 249 + 0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 250 + 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 251 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 252 + 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 253 + 0x18,0x18,0x18,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 254 + 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255 + 0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 256 + 0x18,0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 257 + 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 258 + 0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 259 + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 260 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 261 + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 262 + 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, // 263 + 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, // 264 + 0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, // 265 + 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, // 266 + 0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77, // 267 + 0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00,0x00, // 268 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00, // 269 + 0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00, // 270 + 0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00, // 271 + 0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 272 + 0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, // 273 + 0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00, // 274 + 0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff, // 275 + 0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff, // 276 + 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, // 277 + 0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, // 278 + 0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00, // 279 + 0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, // 280 + 0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, // 281 + 0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 282 + 0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 283 + 0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00, // 284 + 0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 285 + 0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00, // 286 + 0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00, // 287 ]; \ No newline at end of file diff --git a/lib/lib_ascii/src/lib.rs b/lib/lib_ascii/src/lib.rs index 45cf5e3..2a81054 100644 --- a/lib/lib_ascii/src/lib.rs +++ b/lib/lib_ascii/src/lib.rs @@ -30,8 +30,11 @@ pub struct Writer { text_line: u32, // 16 pixels tall text_col: u32, // 8 pixels wide - fg_color: u32, - bg_color: u32 + fg_color: Color, + bg_color: Color, + + offset1: usize, + offset2: usize } impl Writer { @@ -43,26 +46,24 @@ impl Writer { screen_height: writer.height() as u32 / 16, text_line: 0, text_col: 0, - fg_color: 0xFFFFFF, - bg_color: 0x000000 + fg_color: Color::White, + bg_color: Color::Black, + offset1: 16, + offset2: 0 } } else { panic!("Framebuffer writer not initialized"); } } - pub fn write_char(&mut self, mut c: u8) { - if c == b'\n' { + pub fn write_char(&mut self, mut c: u16) { + if c as u8 == b'\n' { self.newline(); return; } - if c < 32 || c > 126 { - c = '?' as u8; - } - // get the character data from the font array. -- each byte is a row of pixels - let data: &[u8] = &FONT[c as usize * 16..(c as usize + 1) * 16]; + let data: &[u8] = &FONT[c as usize * 16 ..(c as usize + 1) * 16]; if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { for row in 0..16 { @@ -73,10 +74,10 @@ impl Writer { if line & (0x80 >> col) != 0 { // write the foreground color - writer.write_pixel(pixel_x as usize, pixel_y as usize, Color::RGB(255, 0, 0)); + writer.write_pixel(pixel_x as usize, pixel_y as usize, self.fg_color); } else { // write the background color - writer.write_pixel(pixel_x as usize, pixel_y as usize, Color::HexARGB(self.bg_color)); + writer.write_pixel(pixel_x as usize, pixel_y as usize, self.bg_color); } } } @@ -90,6 +91,11 @@ impl Writer { } } + pub fn set_offset(&mut self, offset1: usize, offset2: usize) { + self.offset1 = offset1; + self.offset2 = offset2; + } + pub fn dimensions(&self) -> (u32, u32) { (self.screen_width, self.screen_height) } @@ -110,18 +116,18 @@ impl Writer { pub fn write_string(&mut self, s: &str) { for c in s.chars() { - self.write_char(c as u8); + self.write_char(c as u16); } } - pub fn set_colour(&mut self, col: (u32, u32)) { - self.fg_color = col.0; - self.bg_color = col.1; + pub fn set_colour(&mut self, fg: Color, bg: Color) { + self.fg_color = fg; + self.bg_color = bg; } pub fn reset_colour(&mut self) { - self.fg_color = 0xFFFFFF; - self.bg_color = 0x000000; + self.fg_color = Color::White; + self.bg_color = Color::Black; } } @@ -132,27 +138,27 @@ impl core::fmt::Write for Writer { } } -fn write(args: fmt::Arguments, fg_color: u32, bg_color: u32) { +fn write(args: fmt::Arguments, fg: Color, bg: Color) { use core::fmt::Write; interrupts::without_interrupts(|| { let mut writer = WRITER.lock(); - writer.set_colour((fg_color, bg_color)); + writer.set_colour(fg, bg); writer.write_fmt(args).unwrap(); writer.reset_colour(); }); } pub fn _print(args: fmt::Arguments) { - write(args, 0xFFFFFF, 0x000000); + write(args, Color::White, Color::Black); } pub fn _printerr(args: fmt::Arguments) { - write(args, 0xFF8080, 0x000000); + write(args, Color::Red, Color::Black); } pub fn _log(args: fmt::Arguments) { - write(args, 0xFFFF00, 0x000000); + write(args, Color::Yellow, Color::Black); } pub fn clear_screen() { From d9f6b4b69a86fb6328a86907050bffcd0dced832 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 00:58:51 +0000 Subject: [PATCH 08/41] e --- .gitmodules | 3 +++ lib/lib_application | 1 + 2 files changed, 4 insertions(+) create mode 100644 .gitmodules create mode 160000 lib/lib_application diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..215210b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/lib_application"] + path = lib/lib_application + url = https://git.zxq5.dev/OsDev/FoundryOS-lib_application.git diff --git a/lib/lib_application b/lib/lib_application new file mode 160000 index 0000000..df1cbd1 --- /dev/null +++ b/lib/lib_application @@ -0,0 +1 @@ +Subproject commit df1cbd1170723ad75045052dec5b2641fb154591 From 16d94f37cb30e875b6fe0e4530cb15e57bfd6840 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:05:18 +0000 Subject: [PATCH 09/41] moving libs to submodules --- lib/lib_ascii/Cargo.toml | 10 - lib/lib_ascii/src/font.rs | 290 ------------------------- lib/lib_ascii/src/lib.rs | 207 ------------------ lib/lib_framebuffer/Cargo.toml | 8 - lib/lib_framebuffer/src/colour.rs | 51 ----- lib/lib_framebuffer/src/draw.rs | 0 lib/lib_framebuffer/src/framebuffer.rs | 67 ------ lib/lib_framebuffer/src/lib.rs | 20 -- lib/lib_serial/Cargo.toml | 10 - lib/lib_serial/src/io.rs | 23 -- lib/lib_serial/src/lib.rs | 157 ------------- 11 files changed, 843 deletions(-) delete mode 100644 lib/lib_ascii/Cargo.toml delete mode 100644 lib/lib_ascii/src/font.rs delete mode 100644 lib/lib_ascii/src/lib.rs delete mode 100644 lib/lib_framebuffer/Cargo.toml delete mode 100644 lib/lib_framebuffer/src/colour.rs delete mode 100644 lib/lib_framebuffer/src/draw.rs delete mode 100644 lib/lib_framebuffer/src/framebuffer.rs delete mode 100644 lib/lib_framebuffer/src/lib.rs delete mode 100644 lib/lib_serial/Cargo.toml delete mode 100644 lib/lib_serial/src/io.rs delete mode 100644 lib/lib_serial/src/lib.rs diff --git a/lib/lib_ascii/Cargo.toml b/lib/lib_ascii/Cargo.toml deleted file mode 100644 index 674cb7c..0000000 --- a/lib/lib_ascii/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "lib_ascii" -version.workspace = true -edition.workspace = true - -[dependencies] -lazy_static = { version = "1.5.0", default-features = false, features = ["spin_no_std"] } -lib_framebuffer = { path = "../lib_framebuffer" } -spin = "0.9.8" -x86_64 = "0.15.2" diff --git a/lib/lib_ascii/src/font.rs b/lib/lib_ascii/src/font.rs deleted file mode 100644 index 94a37b8..0000000 --- a/lib/lib_ascii/src/font.rs +++ /dev/null @@ -1,290 +0,0 @@ -pub static FONT: [u8; 288 * 16] = [ - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 0 - 0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00, // 1 - 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, // 2 - 0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, // 3 - 0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00, // 4 - 0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 5 - 0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 6 - 0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 7 - 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 8 - 0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff, // 9 - 0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00, // 10 - 0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff, // 11 - 0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, // 12 - 0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, // 13 - 0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00, // 14 - 0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00, // 15 - 0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00, // 16 - 0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, // 17 - 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00, // 18 - 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 19 - 0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00, // 20 - 0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00, // 21 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00, // 22 - 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, // 23 - 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 24 - 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00, // 25 - 0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 26 - 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 27 - 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, // 28 - 0x00,0x00,0x00,0x00,0x00,0x28,0x6c,0xfe,0x6c,0x28,0x00,0x00,0x00,0x00,0x00,0x00, // 29 - 0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00, // 30 - 0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 31 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 32 - 0x00,0x00,0x18,0x3c,0x3c,0x3c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // 33 - 0x00,0x66,0x66,0x66,0x24,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 34 - 0x00,0x00,0x00,0x6c,0x6c,0xfe,0x6c,0x6c,0x6c,0xfe,0x6c,0x6c,0x00,0x00,0x00,0x00, // 35 - 0x18,0x18,0x7c,0xc6,0xc2,0xc0,0x7c,0x06,0x06,0x86,0xc6,0x7c,0x18,0x18,0x00,0x00, // 36 - 0x00,0x00,0x00,0x00,0xc2,0xc6,0x0c,0x18,0x30,0x60,0xc6,0x86,0x00,0x00,0x00,0x00, // 37 - 0x00,0x00,0x38,0x6c,0x6c,0x38,0x76,0xdc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 38 - 0x00,0x30,0x30,0x30,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 39 - 0x00,0x00,0x0c,0x18,0x30,0x30,0x30,0x30,0x30,0x30,0x18,0x0c,0x00,0x00,0x00,0x00, // 40 - 0x00,0x00,0x30,0x18,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x18,0x30,0x00,0x00,0x00,0x00, // 41 - 0x00,0x00,0x00,0x00,0x00,0x66,0x3c,0xff,0x3c,0x66,0x00,0x00,0x00,0x00,0x00,0x00, // 42 - 0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 43 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x18,0x30,0x00,0x00,0x00, // 44 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 45 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // 46 - 0x00,0x00,0x00,0x00,0x02,0x06,0x0c,0x18,0x30,0x60,0xc0,0x80,0x00,0x00,0x00,0x00, // 47 - 0x00,0x00,0x38,0x6c,0xc6,0xc6,0xd6,0xd6,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00, // 48 - 0x00,0x00,0x18,0x38,0x78,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x00,0x00,0x00,0x00, // 49 - 0x00,0x00,0x7c,0xc6,0x06,0x0c,0x18,0x30,0x60,0xc0,0xc6,0xfe,0x00,0x00,0x00,0x00, // 50 - 0x00,0x00,0x7c,0xc6,0x06,0x06,0x3c,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, // 51 - 0x00,0x00,0x0c,0x1c,0x3c,0x6c,0xcc,0xfe,0x0c,0x0c,0x0c,0x1e,0x00,0x00,0x00,0x00, // 52 - 0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xfc,0x06,0x06,0x06,0xc6,0x7c,0x00,0x00,0x00,0x00, // 53 - 0x00,0x00,0x38,0x60,0xc0,0xc0,0xfc,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 54 - 0x00,0x00,0xfe,0xc6,0x06,0x06,0x0c,0x18,0x30,0x30,0x30,0x30,0x00,0x00,0x00,0x00, // 55 - 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7c,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 56 - 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0x7e,0x06,0x06,0x06,0x0c,0x78,0x00,0x00,0x00,0x00, // 57 - 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // 58 - 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x18,0x18,0x30,0x00,0x00,0x00,0x00, // 59 - 0x00,0x00,0x00,0x06,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x06,0x00,0x00,0x00,0x00, // 60 - 0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 61 - 0x00,0x00,0x00,0x60,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x60,0x00,0x00,0x00,0x00, // 62 - 0x00,0x00,0x7c,0xc6,0xc6,0x0c,0x18,0x18,0x18,0x00,0x18,0x18,0x00,0x00,0x00,0x00, // 63 - 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xde,0xde,0xde,0xdc,0xc0,0x7c,0x00,0x00,0x00,0x00, // 64 - 0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 65 - 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x66,0x66,0x66,0x66,0xfc,0x00,0x00,0x00,0x00, // 66 - 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x00,0x00,0x00,0x00, // 67 - 0x00,0x00,0xf8,0x6c,0x66,0x66,0x66,0x66,0x66,0x66,0x6c,0xf8,0x00,0x00,0x00,0x00, // 68 - 0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, // 69 - 0x00,0x00,0xfe,0x66,0x62,0x68,0x78,0x68,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 70 - 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xde,0xc6,0xc6,0x66,0x3a,0x00,0x00,0x00,0x00, // 71 - 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 72 - 0x00,0x00,0x3c,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 73 - 0x00,0x00,0x1e,0x0c,0x0c,0x0c,0x0c,0x0c,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, // 74 - 0x00,0x00,0xe6,0x66,0x66,0x6c,0x78,0x78,0x6c,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, // 75 - 0x00,0x00,0xf0,0x60,0x60,0x60,0x60,0x60,0x60,0x62,0x66,0xfe,0x00,0x00,0x00,0x00, // 76 - 0x00,0x00,0xc6,0xee,0xfe,0xfe,0xd6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 77 - 0x00,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 78 - 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 79 - 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 80 - 0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xd6,0xde,0x7c,0x0c,0x0e,0x00,0x00, // 81 - 0x00,0x00,0xfc,0x66,0x66,0x66,0x7c,0x6c,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, // 82 - 0x00,0x00,0x7c,0xc6,0xc6,0x60,0x38,0x0c,0x06,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 83 - 0x00,0x00,0x7e,0x7e,0x5a,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 84 - 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 85 - 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x6c,0x38,0x10,0x00,0x00,0x00,0x00, // 86 - 0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xd6,0xd6,0xd6,0xfe,0xee,0x6c,0x00,0x00,0x00,0x00, // 87 - 0x00,0x00,0xc6,0xc6,0x6c,0x7c,0x38,0x38,0x7c,0x6c,0xc6,0xc6,0x00,0x00,0x00,0x00, // 88 - 0x00,0x00,0x66,0x66,0x66,0x66,0x3c,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 89 - 0x00,0x00,0xfe,0xc6,0x86,0x0c,0x18,0x30,0x60,0xc2,0xc6,0xfe,0x00,0x00,0x00,0x00, // 90 - 0x00,0x00,0x3c,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x3c,0x00,0x00,0x00,0x00, // 91 - 0x00,0x00,0x00,0x80,0xc0,0xe0,0x70,0x38,0x1c,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, // 92 - 0x00,0x00,0x3c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x0c,0x3c,0x00,0x00,0x00,0x00, // 93 - 0x10,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 94 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00, // 95 - 0x30,0x30,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 96 - 0x00,0x00,0x00,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 97 - 0x00,0x00,0xe0,0x60,0x60,0x78,0x6c,0x66,0x66,0x66,0x66,0x7c,0x00,0x00,0x00,0x00, // 98 - 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc0,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 99 - 0x00,0x00,0x1c,0x0c,0x0c,0x3c,0x6c,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 100 - 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 101 - 0x00,0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 102 - 0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0xcc,0x78,0x00, // 103 - 0x00,0x00,0xe0,0x60,0x60,0x6c,0x76,0x66,0x66,0x66,0x66,0xe6,0x00,0x00,0x00,0x00, // 104 - 0x00,0x00,0x18,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 105 - 0x00,0x00,0x06,0x06,0x00,0x0e,0x06,0x06,0x06,0x06,0x06,0x06,0x66,0x66,0x3c,0x00, // 106 - 0x00,0x00,0xe0,0x60,0x60,0x66,0x6c,0x78,0x78,0x6c,0x66,0xe6,0x00,0x00,0x00,0x00, // 107 - 0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 108 - 0x00,0x00,0x00,0x00,0x00,0xec,0xfe,0xd6,0xd6,0xd6,0xd6,0xc6,0x00,0x00,0x00,0x00, // 109 - 0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 110 - 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 111 - 0x00,0x00,0x00,0x00,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xf0,0x00, // 112 - 0x00,0x00,0x00,0x00,0x00,0x76,0xcc,0xcc,0xcc,0xcc,0xcc,0x7c,0x0c,0x0c,0x1e,0x00, // 113 - 0x00,0x00,0x00,0x00,0x00,0xdc,0x76,0x66,0x60,0x60,0x60,0xf0,0x00,0x00,0x00,0x00, // 114 - 0x00,0x00,0x00,0x00,0x00,0x7c,0xc6,0x60,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00,0x00, // 115 - 0x00,0x00,0x10,0x30,0x30,0xfc,0x30,0x30,0x30,0x30,0x36,0x1c,0x00,0x00,0x00,0x00, // 116 - 0x00,0x00,0x00,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 117 - 0x00,0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x3c,0x18,0x00,0x00,0x00,0x00, // 118 - 0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xd6,0xd6,0xd6,0xfe,0x6c,0x00,0x00,0x00,0x00, // 119 - 0x00,0x00,0x00,0x00,0x00,0xc6,0x6c,0x38,0x38,0x38,0x6c,0xc6,0x00,0x00,0x00,0x00, // 120 - 0x00,0x00,0x00,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0xf8,0x00, // 121 - 0x00,0x00,0x00,0x00,0x00,0xfe,0xcc,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, // 122 - 0x00,0x00,0x0e,0x18,0x18,0x18,0x70,0x18,0x18,0x18,0x18,0x0e,0x00,0x00,0x00,0x00, // 123 - 0x00,0x00,0x18,0x18,0x18,0x18,0x00,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 124 - 0x00,0x00,0x70,0x18,0x18,0x18,0x0e,0x18,0x18,0x18,0x18,0x70,0x00,0x00,0x00,0x00, // 125 - 0x00,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 126 - 0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00, // 127 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 128 - 0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x18,0x3c,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00, // 129 - 0x00,0x18,0x18,0x3c,0x66,0x60,0x60,0x60,0x66,0x3c,0x18,0x18,0x00,0x00,0x00,0x00, // 130 - 0x00,0x38,0x6c,0x64,0x60,0xf0,0x60,0x60,0x60,0x60,0xe6,0xfc,0x00,0x00,0x00,0x00, // 131 - 0x00,0x00,0x66,0x66,0x3c,0x18,0x7e,0x18,0x7e,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 132 - 0x00,0x7c,0xc6,0x60,0x38,0x6c,0xc6,0xc6,0x6c,0x38,0x0c,0xc6,0x7c,0x00,0x00,0x00, // 133 - 0x00,0x3c,0x6c,0x6c,0x3e,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 134 - 0x00,0x00,0x00,0x00,0x00,0x36,0x6c,0xd8,0x6c,0x36,0x00,0x00,0x00,0x00,0x00,0x00, // 135 - 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0x06,0x06,0x06,0x00,0x00,0x00,0x00,0x00, // 136 - 0x00,0x38,0x6c,0x6c,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 137 - 0x00,0x00,0x00,0x00,0x18,0x18,0x7e,0x18,0x18,0x00,0x00,0xff,0x00,0x00,0x00,0x00, // 138 - 0x00,0x70,0xd8,0x30,0x60,0xc8,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 139 - 0x00,0x00,0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x7c,0x60,0x60,0xc0,0x00,0x00,0x00, // 140 - 0x00,0x00,0x7f,0xdb,0xdb,0xdb,0x7b,0x1b,0x1b,0x1b,0x1b,0x1b,0x00,0x00,0x00,0x00, // 141 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 142 - 0x00,0x38,0x6c,0x6c,0x38,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 143 - 0x00,0x00,0x00,0x00,0x00,0xd8,0x6c,0x36,0x6c,0xd8,0x00,0x00,0x00,0x00,0x00,0x00, // 144 - 0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x66,0xce,0x9e,0x3e,0x06,0x06,0x00,0x00, // 145 - 0x00,0xc0,0xc0,0xc2,0xc6,0xcc,0x18,0x30,0x60,0xdc,0x86,0x0c,0x18,0x3e,0x00,0x00, // 146 - 0x00,0x00,0x30,0x30,0x00,0x30,0x30,0x60,0xc0,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 147 - 0x00,0xc6,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 148 - 0x38,0x6c,0x38,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 149 - 0x00,0x00,0x3e,0x6c,0xcc,0xcc,0xfe,0xcc,0xcc,0xcc,0xcc,0xce,0x00,0x00,0x00,0x00, // 150 - 0x00,0x00,0x3c,0x66,0xc2,0xc0,0xc0,0xc0,0xc2,0x66,0x3c,0x0c,0x06,0x7c,0x00,0x00, // 151 - 0x18,0x30,0x60,0x00,0xfe,0x66,0x60,0x7c,0x60,0x60,0x66,0xfe,0x00,0x00,0x00,0x00, // 152 - 0x76,0xdc,0x00,0xc6,0xe6,0xf6,0xfe,0xde,0xce,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 153 - 0x00,0xc6,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 154 - 0x00,0xc6,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 155 - 0x00,0x00,0x78,0xcc,0xcc,0xcc,0xd8,0xcc,0xc6,0xc6,0xc6,0xcc,0x00,0x00,0x00,0x00, // 156 - 0x00,0x60,0x30,0x18,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 157 - 0x00,0x18,0x30,0x60,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 158 - 0x00,0x10,0x38,0x6c,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 159 - 0x00,0x00,0xcc,0x00,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 160 - 0x00,0x38,0x6c,0x38,0x00,0x78,0x0c,0x7c,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 161 - 0x00,0x00,0x00,0x00,0x00,0xcc,0x76,0x36,0x7e,0xd8,0xd8,0x6e,0x00,0x00,0x00,0x00, // 162 - 0x00,0x00,0x00,0x00,0x3c,0x66,0x60,0x60,0x66,0x3c,0x0c,0x06,0x3c,0x00,0x00,0x00, // 163 - 0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 164 - 0x00,0x0c,0x18,0x30,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 165 - 0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 166 - 0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xfe,0xc0,0xc0,0xc6,0x7c,0x00,0x00,0x00,0x00, // 167 - 0x00,0x60,0x30,0x18,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 168 - 0x00,0x0c,0x18,0x30,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 169 - 0x00,0x18,0x3c,0x66,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 170 - 0x00,0x00,0x66,0x00,0x00,0x38,0x18,0x18,0x18,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 171 - 0x00,0x00,0x76,0xdc,0x00,0xdc,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x00,0x00,0x00, // 172 - 0x00,0x60,0x30,0x18,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 173 - 0x00,0x18,0x30,0x60,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 174 - 0x00,0x10,0x38,0x6c,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 175 - 0x00,0x00,0xc6,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0x7c,0x00,0x00,0x00,0x00, // 176 - 0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x7e,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00, // 177 - 0x00,0x60,0x30,0x18,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 178 - 0x00,0x18,0x30,0x60,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 179 - 0x00,0x30,0x78,0xcc,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 180 - 0x00,0x00,0xcc,0x00,0x00,0xcc,0xcc,0xcc,0xcc,0xcc,0xcc,0x76,0x00,0x00,0x00,0x00, // 181 - 0x00,0x00,0xc6,0x00,0x00,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x7e,0x06,0x0c,0x78,0x00, // 182 - 0x00,0x0e,0x1b,0x18,0x18,0x18,0x7e,0x18,0x18,0x18,0x18,0x18,0xd8,0x70,0x00,0x00, // 183 - 0x00,0x00,0xfe,0xc6,0xc6,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00, // 184 - 0x00,0x00,0x00,0x38,0x6c,0xc6,0xc6,0xfe,0xc6,0xc6,0x6c,0x38,0x00,0x00,0x00,0x00, // 185 - 0x00,0x00,0x00,0xfe,0xc6,0x60,0x30,0x18,0x30,0x60,0xc6,0xfe,0x00,0x00,0x00,0x00, // 186 - 0x00,0x00,0x00,0x7e,0x18,0x3c,0x66,0x66,0x66,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, // 187 - 0x00,0x00,0x38,0x6c,0xc6,0xc6,0xc6,0x6c,0x6c,0x6c,0x6c,0xee,0x00,0x00,0x00,0x00, // 188 - 0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0xd8,0xd8,0xd8,0xdc,0x76,0x00,0x00,0x00,0x00, // 189 - 0x00,0x00,0x1e,0x30,0x18,0x0c,0x3e,0x66,0x66,0x66,0x66,0x3c,0x00,0x00,0x00,0x00, // 190 - 0x00,0x00,0x1c,0x30,0x60,0x60,0x7c,0x60,0x60,0x60,0x30,0x1c,0x00,0x00,0x00,0x00, // 191 - 0x00,0x00,0x00,0x00,0xfe,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00, // 192 - 0x00,0x00,0x00,0x00,0x00,0x7e,0xd8,0xd8,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, // 193 - 0x00,0x00,0x00,0x00,0x76,0xdc,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 194 - 0x00,0x00,0x00,0x03,0x06,0x7e,0xdb,0xdb,0xf3,0x7e,0x60,0xc0,0x00,0x00,0x00,0x00, // 195 - 0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3c,0x3c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 196 - 0x00,0x00,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x00,0x66,0x66,0x00,0x00,0x00,0x00, // 197 - 0x00,0xd8,0x6c,0x6c,0x6c,0x6c,0x6c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 198 - 0x00,0xf8,0xcc,0xcc,0xf8,0xc4,0xcc,0xde,0xcc,0xcc,0xcc,0xc6,0x00,0x00,0x00,0x00, // 199 - 0x00,0x00,0x00,0x00,0x00,0x30,0x60,0xfe,0x60,0x30,0x00,0x00,0x00,0x00,0x00,0x00, // 200 - 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00,0x00,0x00,0x00, // 201 - 0x00,0x00,0x00,0x00,0x00,0x18,0x0c,0xfe,0x0c,0x18,0x00,0x00,0x00,0x00,0x00,0x00, // 202 - 0x00,0x00,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00, // 203 - 0x00,0x00,0x00,0x00,0x00,0x28,0x6c,0xfe,0x6c,0x28,0x00,0x00,0x00,0x00,0x00,0x00, // 204 - 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x00,0x00,0x00,0x00,0x00, // 205 - 0x00,0x00,0x18,0x3c,0x7e,0x18,0x18,0x18,0x7e,0x3c,0x18,0x7e,0x00,0x00,0x00,0x00, // 206 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 207 - 0x00,0x0f,0x0c,0x0c,0x0c,0x0c,0x0c,0xec,0x6c,0x6c,0x3c,0x1c,0x00,0x00,0x00,0x00, // 208 - 0x00,0x00,0x00,0x00,0x00,0x7e,0xdb,0xdb,0xdb,0x7e,0x00,0x00,0x00,0x00,0x00,0x00, // 209 - 0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xc0,0xc0,0xfe,0x00,0x00,0x00,0x00,0x00,0x00, // 210 - 0x00,0x00,0x00,0x7c,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0xc6,0x00,0x00,0x00,0x00, // 211 - 0x00,0x00,0x00,0x00,0x00,0x76,0xdc,0x00,0x76,0xdc,0x00,0x00,0x00,0x00,0x00,0x00, // 212 - 0x00,0x00,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0xfe,0x00,0x00,0x00,0x00,0x00, // 213 - 0x00,0x00,0x00,0x0c,0x18,0x30,0x60,0x30,0x18,0x0c,0x00,0x7e,0x00,0x00,0x00,0x00, // 214 - 0x00,0x00,0x00,0x30,0x18,0x0c,0x06,0x0c,0x18,0x30,0x00,0x7e,0x00,0x00,0x00,0x00, // 215 - 0x00,0x00,0x00,0x00,0x10,0x38,0x6c,0xc6,0xc6,0xc6,0xfe,0x00,0x00,0x00,0x00,0x00, // 216 - 0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xc0,0xc0,0xc0,0xc0,0x00,0x00,0x00,0x00,0x00, // 217 - 0x00,0x00,0x0e,0x1b,0x1b,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 218 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xd8,0xd8,0xd8,0x70,0x00,0x00,0x00,0x00, // 219 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 220 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 221 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 222 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 223 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 224 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 225 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 226 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 227 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 228 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 229 - 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 230 - 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 231 - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 232 - 0x00,0x00,0x00,0x00,0x00,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 233 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 234 - 0x00,0x00,0x00,0x00,0x00,0x3f,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 235 - 0x00,0x00,0x00,0x00,0x00,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 236 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 237 - 0x00,0x00,0x00,0x00,0x00,0xfe,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 238 - 0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 239 - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 240 - 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 241 - 0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 242 - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 243 - 0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 244 - 0x18,0x18,0x18,0x18,0x18,0x1f,0x18,0x1f,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 245 - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 246 - 0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x37,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 247 - 0x18,0x18,0x18,0x18,0x18,0xf8,0x18,0xf8,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 248 - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 249 - 0x36,0x36,0x36,0x36,0x36,0xf6,0x06,0xf6,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 250 - 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 251 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 252 - 0x00,0x00,0x00,0x00,0x00,0xff,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 253 - 0x18,0x18,0x18,0x18,0x18,0xff,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 254 - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 255 - 0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 256 - 0x18,0x18,0x18,0x18,0x18,0xff,0x18,0xff,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18, // 257 - 0x36,0x36,0x36,0x36,0x36,0x36,0x36,0xff,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 258 - 0x36,0x36,0x36,0x36,0x36,0xf7,0x00,0xf7,0x36,0x36,0x36,0x36,0x36,0x36,0x36,0x36, // 259 - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, // 260 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 261 - 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, // 262 - 0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0, // 263 - 0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f,0x0f, // 264 - 0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44,0x11,0x44, // 265 - 0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa,0x55,0xaa, // 266 - 0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77,0xdd,0x77, // 267 - 0x00,0x00,0x00,0x00,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x7c,0x00,0x00,0x00,0x00,0x00, // 268 - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0xfe,0xfe,0xfe,0x00,0x00,0x00,0x00, // 269 - 0x00,0x00,0x00,0x00,0x10,0x38,0x38,0x7c,0x7c,0xfe,0xfe,0x00,0x00,0x00,0x00,0x00, // 270 - 0x00,0x80,0xc0,0xe0,0xf0,0xf8,0xfe,0xf8,0xf0,0xe0,0xc0,0x80,0x00,0x00,0x00,0x00, // 271 - 0x00,0x00,0x00,0x00,0xfe,0xfe,0x7c,0x7c,0x38,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 272 - 0x00,0x02,0x06,0x0e,0x1e,0x3e,0xfe,0x3e,0x1e,0x0e,0x06,0x02,0x00,0x00,0x00,0x00, // 273 - 0x00,0x00,0x00,0x00,0x00,0x3c,0x66,0x42,0x42,0x66,0x3c,0x00,0x00,0x00,0x00,0x00, // 274 - 0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xc3,0xc3,0xe7,0xff,0xff,0xff,0xff,0xff,0xff, // 275 - 0xff,0xff,0xff,0xff,0xff,0xc3,0x99,0xbd,0xbd,0x99,0xc3,0xff,0xff,0xff,0xff,0xff, // 276 - 0x00,0x00,0x7e,0x81,0xa5,0x81,0x81,0xbd,0x99,0x81,0x81,0x7e,0x00,0x00,0x00,0x00, // 277 - 0x00,0x00,0x7e,0xff,0xdb,0xff,0xff,0xc3,0xe7,0xff,0xff,0x7e,0x00,0x00,0x00,0x00, // 278 - 0x00,0x00,0x00,0x18,0x18,0xdb,0x3c,0xe7,0x3c,0xdb,0x18,0x18,0x00,0x00,0x00,0x00, // 279 - 0x00,0x00,0x3c,0x66,0x66,0x66,0x66,0x3c,0x18,0x7e,0x18,0x18,0x00,0x00,0x00,0x00, // 280 - 0x00,0x00,0x1e,0x0e,0x1a,0x32,0x78,0xcc,0xcc,0xcc,0xcc,0x78,0x00,0x00,0x00,0x00, // 281 - 0x00,0x00,0x00,0x18,0x3c,0x7e,0xff,0xff,0x7e,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 282 - 0x00,0x00,0x00,0x18,0x3c,0x3c,0xe7,0xe7,0xe7,0x18,0x18,0x3c,0x00,0x00,0x00,0x00, // 283 - 0x00,0x00,0x00,0x00,0x6c,0xfe,0xfe,0xfe,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00, // 284 - 0x00,0x00,0x00,0x00,0x10,0x38,0x7c,0xfe,0x7c,0x38,0x10,0x00,0x00,0x00,0x00,0x00, // 285 - 0x00,0x00,0x3f,0x33,0x3f,0x30,0x30,0x30,0x30,0x70,0xf0,0xe0,0x00,0x00,0x00,0x00, // 286 - 0x00,0x00,0x7f,0x63,0x7f,0x63,0x63,0x63,0x63,0x67,0xe7,0xe6,0xc0,0x00,0x00,0x00, // 287 -]; \ No newline at end of file diff --git a/lib/lib_ascii/src/lib.rs b/lib/lib_ascii/src/lib.rs deleted file mode 100644 index 2a81054..0000000 --- a/lib/lib_ascii/src/lib.rs +++ /dev/null @@ -1,207 +0,0 @@ -#![no_std] - -use core::fmt; -use lazy_static::lazy_static; -use spin::{Lazy, Mutex}; -use x86_64::instructions::interrupts; - -use lib_framebuffer::{FRAMEBUFFER_WRITER, Color}; - -mod font; -use font::FONT; - -static FONT_WIDTH: u32 = 8; -static FONT_HEIGHT: u32 = 16; - -pub static WRITER: Lazy> = Lazy::new(|| Mutex::new(Writer::new())); - - - -pub fn screensize_chars() -> (u32, u32) { - let writer = WRITER.lock(); - (writer.screen_width, writer.screen_height) -} - -pub struct Writer { - // these are measured in chars NOT pixels - screen_width: u32, - screen_height: u32, - - text_line: u32, // 16 pixels tall - text_col: u32, // 8 pixels wide - - fg_color: Color, - bg_color: Color, - - offset1: usize, - offset2: usize -} - -impl Writer { - - pub fn new() -> Self { - if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { - Self { - screen_width: writer.width() as u32 / 8, - screen_height: writer.height() as u32 / 16, - text_line: 0, - text_col: 0, - fg_color: Color::White, - bg_color: Color::Black, - offset1: 16, - offset2: 0 - } - } else { - panic!("Framebuffer writer not initialized"); - } - } - - pub fn write_char(&mut self, mut c: u16) { - if c as u8 == b'\n' { - self.newline(); - return; - } - - // get the character data from the font array. -- each byte is a row of pixels - let data: &[u8] = &FONT[c as usize * 16 ..(c as usize + 1) * 16]; - - if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { - for row in 0..16 { - let line: u8 = data[row]; - for col in 0..8 { - let pixel_x: u32 = self.text_col * FONT_WIDTH + col; - let pixel_y: u32 = self.text_line * FONT_HEIGHT + row as u32; - - if line & (0x80 >> col) != 0 { - // write the foreground color - writer.write_pixel(pixel_x as usize, pixel_y as usize, self.fg_color); - } else { - // write the background color - writer.write_pixel(pixel_x as usize, pixel_y as usize, self.bg_color); - } - } - } - } - - // go to next position - if self.text_col + 1 >= self.screen_width { - self.newline(); - } else { - self.text_col += 1; - } - } - - pub fn set_offset(&mut self, offset1: usize, offset2: usize) { - self.offset1 = offset1; - self.offset2 = offset2; - } - - pub fn dimensions(&self) -> (u32, u32) { - (self.screen_width, self.screen_height) - } - - pub fn next_char(&mut self) { - self.text_col += 1; - } - - pub fn newline(&mut self) { - self.text_col = 0; - - if self.text_line + 1 >= self.screen_height { - self.text_line = 0; - } else { - self.text_line += 1; - } - } - - pub fn write_string(&mut self, s: &str) { - for c in s.chars() { - self.write_char(c as u16); - } - } - - pub fn set_colour(&mut self, fg: Color, bg: Color) { - self.fg_color = fg; - self.bg_color = bg; - } - - pub fn reset_colour(&mut self) { - self.fg_color = Color::White; - self.bg_color = Color::Black; - } -} - -impl core::fmt::Write for Writer { - fn write_str(&mut self, s: &str) -> core::fmt::Result { - self.write_string(s); - Ok(()) - } -} - -fn write(args: fmt::Arguments, fg: Color, bg: Color) { - use core::fmt::Write; - - interrupts::without_interrupts(|| { - let mut writer = WRITER.lock(); - writer.set_colour(fg, bg); - writer.write_fmt(args).unwrap(); - writer.reset_colour(); - }); -} - -pub fn _print(args: fmt::Arguments) { - write(args, Color::White, Color::Black); -} - -pub fn _printerr(args: fmt::Arguments) { - write(args, Color::Red, Color::Black); -} - -pub fn _log(args: fmt::Arguments) { - write(args, Color::Yellow, Color::Black); -} - -pub fn clear_screen() { - interrupts::without_interrupts(|| { - let mut writer = WRITER.lock(); - writer.text_line = 0; - writer.text_col = 0; - - if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { - writer.clear(); - } - }); -} - -#[macro_export] -macro_rules! println_log { - () => ($crate::print_log!("\n")); - ($($arg:tt)*) => ($crate::print_log!("{}\n", format_args!($($arg)*))); -} - -#[macro_export] -macro_rules! print_log { - ($($arg:tt)*) => ($crate::_log(format_args!($($arg)*))); -} - -#[macro_export] -macro_rules! println { - () => ($crate::print!("\n")); - ($($arg:tt)*) => ($crate::print!("{}\n", format_args!($($arg)*))); -} - -#[macro_export] -macro_rules! print { - ($($arg:tt)*) => ($crate::_print(format_args!($($arg)*))); -} - -#[macro_export] -macro_rules! printlnerr { - () => ($crate::printerr!("\n")); - ($($arg:tt)*) => ($crate::printerr!("{}\n", format_args!($($arg)*))); -} - -#[macro_export] -macro_rules! printerr { - ($($arg:tt)*) => ($crate::_printerr(format_args!($($arg)*))); -} \ No newline at end of file diff --git a/lib/lib_framebuffer/Cargo.toml b/lib/lib_framebuffer/Cargo.toml deleted file mode 100644 index 19737e4..0000000 --- a/lib/lib_framebuffer/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "lib_framebuffer" -version.workspace = true -edition.workspace = true - -[dependencies] -limine = "0.3.1" -spin = "0.9.8" diff --git a/lib/lib_framebuffer/src/colour.rs b/lib/lib_framebuffer/src/colour.rs deleted file mode 100644 index 7477864..0000000 --- a/lib/lib_framebuffer/src/colour.rs +++ /dev/null @@ -1,51 +0,0 @@ -#[repr(u32)] -#[derive(Copy, Clone, PartialEq, Eq, Debug)] -pub enum Color { - ARGB(u8, u8, u8, u8), - RGB(u8, u8, u8), - HexARGB(u32), - Black = 0x000000FF, - Blue = 0x0000FFFF, - Green = 0x00FF00FF, - Cyan = 0x00FFFFFF, - Red = 0xFF0000FF, - Magenta = 0xFF00FFFF, - Yellow = 0xFFFF00FF, - White = 0xFFFFFFFF, -} - -impl Into for Color { - fn into(self) -> u32 { - match self { - Color::ARGB(a, r, g, b) => (a as u32) << 24 | (r as u32) << 16 | (g as u32) << 8 | (b as u32), - Color::RGB(r, g, b) => (0u32) << 24 | (r as u32) << 16 | (g as u32) << 8 | (b as u32), - Color::HexARGB(hex) => hex, - Color::Black => 0xFF000000, - Color::Blue => 0xFF0000FF, - Color::Green => 0xFF00FF00, - Color::Cyan => 0xFF00FFFF, - Color::Red => 0xFFFF0000, - Color::Magenta => 0xFFFF00FF, - Color::Yellow => 0xFFFFFF00, - Color::White => 0xFFFFFFFF, - } - } -} - -impl core::fmt::Display for Color { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - match self { - Color::ARGB(r, g, b, a) => write!(f, "RGBA(#{:x}{:x}{:x}{:x})", r, g, b, a), - Color::RGB(r, g, b) => write!(f, "RGB(#{:x}{:x}{:x})", r, g, b), - Color::HexARGB(hex) => write!(f, "Hex(#{:x})", hex), - Color::Black => write!(f, "Black"), - Color::Blue => write!(f, "Blue"), - Color::Green => write!(f, "Green"), - Color::Cyan => write!(f, "Cyan"), - Color::Red => write!(f, "Red"), - Color::Magenta => write!(f, "Magenta"), - Color::Yellow => write!(f, "Yellow"), - Color::White => write!(f, "White"), - } - } -} \ No newline at end of file diff --git a/lib/lib_framebuffer/src/draw.rs b/lib/lib_framebuffer/src/draw.rs deleted file mode 100644 index e69de29..0000000 diff --git a/lib/lib_framebuffer/src/framebuffer.rs b/lib/lib_framebuffer/src/framebuffer.rs deleted file mode 100644 index 0d91287..0000000 --- a/lib/lib_framebuffer/src/framebuffer.rs +++ /dev/null @@ -1,67 +0,0 @@ -use core::panic; -use limine::framebuffer::Framebuffer; -use spin::{Mutex, Lazy}; - -use crate::{colour::Color, FRAMEBUFFER_REQUEST}; - -pub static FRAMEBUFFER_WRITER: Lazy>> = Lazy::new(|| Mutex::new( - if let Some(framebuffer_response) = FRAMEBUFFER_REQUEST.get_response() { - let framebuffer = framebuffer_response.framebuffers().next().unwrap(); - Some(FramebufferWriter::new(framebuffer)) - } else { - panic!("Framebuffer request failed"); - } -)); - - - -pub struct FramebufferWriter<'a> { - framebuffer: Framebuffer<'a>, -} - -unsafe impl<'a> Send for FramebufferWriter<'a> {} -unsafe impl<'a> Sync for FramebufferWriter<'a> {} -impl<'a> FramebufferWriter<'a> { - pub fn new(framebuffer: Framebuffer<'a>) -> Self { - Self { - framebuffer, - } - } - - pub fn write_pixel(&self, x: usize, y: usize, color: Color) { - let pitch = self.framebuffer.pitch() as usize; - let bpp = (self.framebuffer.bpp() / 8) as usize; - let pixel_offset = y * pitch + x * bpp; - - unsafe { - *(self.framebuffer.addr().add(pixel_offset) as *mut u32) = color.into(); - } - } - - pub fn render_frame(&self, buffer: &[Color; 1280 * 800]) { - for (y, row) in buffer.chunks(1280).enumerate() { - for (x, pixel) in row.iter().enumerate() { - self.write_pixel(x, y, *pixel); - } - } - } - - pub fn width(&self) -> u32 { - self.framebuffer.width() as u32 - } - - pub fn height(&self) -> u32 { - self.framebuffer.height() as u32 - } - - pub fn clear(&self) { - let width = self.framebuffer.width() as usize; - let height = self.framebuffer.height() as usize; - - for y in 0..height { - for x in 0..width { - self.write_pixel(x, y, Color::Black); - } - } - } -} \ No newline at end of file diff --git a/lib/lib_framebuffer/src/lib.rs b/lib/lib_framebuffer/src/lib.rs deleted file mode 100644 index 5b16a7c..0000000 --- a/lib/lib_framebuffer/src/lib.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![no_std] - -use limine::request::FramebufferRequest; - -#[used] -#[link_section = ".requests"] -static FRAMEBUFFER_REQUEST: FramebufferRequest = FramebufferRequest::new(); - -mod framebuffer; -mod colour; -pub use framebuffer::FRAMEBUFFER_WRITER; -pub use colour::Color; - -pub fn screensize_px() -> (u32, u32) { - if let Some(writer) = FRAMEBUFFER_WRITER.lock().as_mut() { - (writer.width(), writer.height()) - } else { - (0, 0) - } -} \ No newline at end of file diff --git a/lib/lib_serial/Cargo.toml b/lib/lib_serial/Cargo.toml deleted file mode 100644 index fdd0427..0000000 --- a/lib/lib_serial/Cargo.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "lib_serial" -version.workspace = true -edition.workspace = true - -[dependencies] -lazy_static = { version = "1.5.0", default-features = false, features = ["spin_no_std"] } -spin = "0.9.8" -x86_64 = "0.15.2" - diff --git a/lib/lib_serial/src/io.rs b/lib/lib_serial/src/io.rs deleted file mode 100644 index 994cbf0..0000000 --- a/lib/lib_serial/src/io.rs +++ /dev/null @@ -1,23 +0,0 @@ -use core::arch::asm; - -#[inline] -pub unsafe fn inb(port: u16) -> u8 { - let value: u8; - asm!( - "in al, dx", - out("al") value, - in("dx") port, - options(nomem, nostack, preserves_flags) - ); - value -} - -#[inline] -pub unsafe fn outb(port: u16, value: u8) { - asm!( - "out dx, al", - in("dx") port, - in("al") value, - options(nomem, nostack, preserves_flags) - ); -} \ No newline at end of file diff --git a/lib/lib_serial/src/lib.rs b/lib/lib_serial/src/lib.rs deleted file mode 100644 index 59fb98c..0000000 --- a/lib/lib_serial/src/lib.rs +++ /dev/null @@ -1,157 +0,0 @@ -#![no_std] - -use core::{fmt, sync::atomic::{AtomicUsize, Ordering}}; -use spin::Mutex; -use lazy_static::lazy_static; - -mod io; -use io::*; -use x86_64::instructions::interrupts; - -static PORT: u16 = 0x3f8; -static mut BUFFER: [u8; 256] = [0; 256]; -static BUFFER_LEN: AtomicUsize = AtomicUsize::new(0); - -lazy_static!{ - static ref READER: Mutex> = Mutex::new(None); - static ref WRITER: Mutex> = Mutex::new(None); -} - -struct Reader; - -struct Writer; - -impl fmt::Write for Writer { - fn write_str(&mut self, s: &str) -> fmt::Result { - for c in s.chars() { - self.write_byte(c as u8); - } - Ok(()) - } -} - -impl Writer { - unsafe fn write_success(&self) -> bool { - inb(PORT + 5) & 0x20 != 0 - } - - pub fn write_byte(&self, data: u8) { unsafe { - while !self.write_success() {}; - outb(PORT + 0, data); - }} -} - - -pub fn init() -> Result<(), &'static str> { - if let Err(e) = test() { - return Err(e); - } - - if READER.lock().is_none() { - *READER.lock() = Some(Reader); - } - - if WRITER.lock().is_none() { - *WRITER.lock() = Some(Writer); - } - - Ok(()) -} - -pub fn test() -> Result<(), &'static str> { - unsafe { - outb(PORT + 1, 0x00); // Disable all interrupts - outb(PORT + 3, 0x80); // Enable DLAB (set baud rate divisor) - outb(PORT + 0, 0x03); // Set divisor to 3 (lo byte) 38400 baud - outb(PORT + 1, 0x00); // (hi byte) - outb(PORT + 3, 0x03); // 8 bits, no parity, one stop bit - outb(PORT + 2, 0xC7); // Enable FIFO, clear them, with 14-bytethreshold - outb(PORT + 4, 0x0B); // IRQs enabled, RTS/DSR set - outb(PORT + 4, 0x1E); // Set in loopback mode, test the serial chip - outb(PORT + 0, 0xAE); // Test serial chip (send byte 0xAE and check if serial returns same byte) - - if inb(PORT + 0) != 0xAE { - return Err("serial test failed") - } - - outb(PORT + 4, 0x0F); - } - - Ok(()) -} - -impl Reader { - pub fn read_str_to_buffer(&mut self) { unsafe { - while !self.read_ready() {}; - - BUFFER_LEN.store(0, Ordering::SeqCst); - - while BUFFER_LEN.load(Ordering::SeqCst) < 256 { - let c = self.read(); - BUFFER[BUFFER_LEN.load(Ordering::SeqCst)] = c; - if c as char == '\r' { - break; - } - BUFFER_LEN.fetch_add(1, Ordering::SeqCst); - } - - serial_println!("returning") - }} - - unsafe fn read_ready(&self) -> bool { - inb(PORT + 5) & 1 != 0 - } - - pub fn read(&self) -> u8 { unsafe { - while !self.read_ready() {}; - return inb(PORT + 0); - }} -} - -pub fn _serial_write(args: fmt::Arguments) { - use core::fmt::Write; - - interrupts::without_interrupts(|| { - if let Some(writer) = WRITER.lock().as_mut() { - writer.write_fmt(args).unwrap(); - } - }) -} - -#[macro_export] -macro_rules! serial_println { - () => ($crate::serial_print!("\n")); - ($($arg:tt)*) => ($crate::serial_print!("{}\n", format_args!($($arg)*))); -} - -#[macro_export] -macro_rules! serial_print { - ($($arg:tt)*) => ($crate::_serial_write(format_args!($($arg)*))); -} - -pub fn serial_read() -> &'static str { - serial_println!("getting value!"); - - interrupts::without_interrupts(|| { - if let Some(reader) = READER.lock().as_mut() { - serial_println!("stuff happnin."); - reader.read_str_to_buffer(); - } else { - serial_println!("failed to get writer"); - } - }); - - serial_println!("eee"); - - let i = BUFFER_LEN.load(Ordering::SeqCst); - - return unsafe { - if i != 0 { - core::str::from_utf8(&BUFFER[..i - 1]).unwrap() - } else { - serial_println!("empty string"); - "" - } - } -} - From cb77883f4cfd895adeef8b359d31fdf3d9fc2576 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:06:27 +0000 Subject: [PATCH 10/41] done --- .gitmodules | 9 +++++++++ lib/lib_ascii | 1 + lib/lib_framebuffer | 1 + lib/lib_serial | 1 + 4 files changed, 12 insertions(+) create mode 160000 lib/lib_ascii create mode 160000 lib/lib_framebuffer create mode 160000 lib/lib_serial diff --git a/.gitmodules b/.gitmodules index 215210b..de08738 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,12 @@ [submodule "lib/lib_application"] path = lib/lib_application url = https://git.zxq5.dev/OsDev/FoundryOS-lib_application.git +[submodule "lib/lib_ascii"] + path = lib/lib_ascii + url = https://git.zxq5.dev/OsDev/FoundryOS-lib_ascii.git +[submodule "lib/lib_framebuffer"] + path = lib/lib_framebuffer + url = https://git.zxq5.dev/OsDev/FoundryOS-lib_framebuffer.git +[submodule "lib/lib_serial"] + path = lib/lib_serial + url = https://git.zxq5.dev/OsDev/FoundryOS-lib_serial.git diff --git a/lib/lib_ascii b/lib/lib_ascii new file mode 160000 index 0000000..fefe217 --- /dev/null +++ b/lib/lib_ascii @@ -0,0 +1 @@ +Subproject commit fefe217980e5535bfb9de4de1dbc84db3def93ae diff --git a/lib/lib_framebuffer b/lib/lib_framebuffer new file mode 160000 index 0000000..c515b89 --- /dev/null +++ b/lib/lib_framebuffer @@ -0,0 +1 @@ +Subproject commit c515b8913625728924cef92993cb65aa03e2b1c5 diff --git a/lib/lib_serial b/lib/lib_serial new file mode 160000 index 0000000..92032eb --- /dev/null +++ b/lib/lib_serial @@ -0,0 +1 @@ +Subproject commit 92032eb5b400fe1afd851dfd613e6d98f04eda40 From 1b313c67e0383013261e3fa9c21e113dfe11eca7 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:06:55 +0000 Subject: [PATCH 11/41] first interrupt handler + setup IDT --- Cargo.lock | 24 +- kernel/Cargo.toml | 4 +- kernel/src/arch/mod.rs | 1 + kernel/src/arch/x86_64/interrupts.rs | 22 ++ kernel/src/arch/x86_64/mod.rs | 1 + kernel/src/lib.rs | 62 +++++ kernel/src/main.rs | 63 +---- script.py | 389 +++++++++++++++++++++++++++ 8 files changed, 502 insertions(+), 64 deletions(-) create mode 100644 kernel/src/arch/mod.rs create mode 100644 kernel/src/arch/x86_64/interrupts.rs create mode 100644 kernel/src/arch/x86_64/mod.rs create mode 100644 kernel/src/lib.rs create mode 100644 script.py diff --git a/Cargo.lock b/Cargo.lock index 9dd5c5a..4d3f2cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,19 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "FoundryOS" +version = "0.1.0" +dependencies = [ + "cc", + "lib_ascii", + "lib_framebuffer", + "lib_serial", + "limine", + "spin", + "x86_64", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -29,17 +42,6 @@ dependencies = [ "shlex", ] -[[package]] -name = "kernel" -version = "0.1.0" -dependencies = [ - "cc", - "lib_ascii", - "lib_framebuffer", - "lib_serial", - "limine", -] - [[package]] name = "lazy_static" version = "1.5.0" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index d9d4087..2619042 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "kernel" +name = "FoundryOS" version = "0.1.0" edition = "2021" @@ -8,6 +8,8 @@ limine = "0.3.1" lib_framebuffer = { path = "../lib/lib_framebuffer" } lib_serial = { path = "../lib/lib_serial" } lib_ascii = { path = "../lib/lib_ascii" } +x86_64 = "0.15.2" +spin = "0.9.8" [build-dependencies] cc = "1.2.14" diff --git a/kernel/src/arch/mod.rs b/kernel/src/arch/mod.rs new file mode 100644 index 0000000..0bffdbe --- /dev/null +++ b/kernel/src/arch/mod.rs @@ -0,0 +1 @@ +pub mod x86_64; \ No newline at end of file diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs new file mode 100644 index 0000000..56a0b21 --- /dev/null +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -0,0 +1,22 @@ +use lib_ascii::println_log; +use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; + +use spin::Lazy; + +static IDT: Lazy = Lazy::new(|| { + let mut idt = InterruptDescriptorTable::new(); + idt.breakpoint.set_handler_fn(breakpoint_handler); + idt +}); + + +pub fn init_idt() { + IDT.load(); +} + +extern "x86-interrupt" fn breakpoint_handler( + stack_frame: InterruptStackFrame +) { + println_log!("Exception: Breakpoint\n{:#?}", stack_frame); +} + diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs new file mode 100644 index 0000000..4c09fa4 --- /dev/null +++ b/kernel/src/arch/x86_64/mod.rs @@ -0,0 +1 @@ +pub mod interrupts; \ No newline at end of file diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs new file mode 100644 index 0000000..78dd3ba --- /dev/null +++ b/kernel/src/lib.rs @@ -0,0 +1,62 @@ +#![no_std] + +#![feature(abi_x86_interrupt)] + +use core::arch::asm; +use limine::request::{RequestsEndMarker, RequestsStartMarker}; +use limine::BaseRevision; + +pub use lib_serial::{serial_print, serial_println, serial_read}; +pub use lib_ascii::{print, print_log, println, println_log, WRITER}; + +mod arch; + +use lib_framebuffer; + + +/// Sets the base revision to the latest revision supported by the crate. +/// See specification for further info. +/// Be sure to mark all limine requests with #[used], otherwise they may be removed by the compiler. +#[used] +// The .requests section allows limine to find the requests faster and more safely. +#[link_section = ".requests"] +static BASE_REVISION: BaseRevision = BaseRevision::new(); + +/// Define the stand and end markers for Limine requests. +#[used] +#[link_section = ".requests_start_marker"] +static _START_MARKER: RequestsStartMarker = RequestsStartMarker::new(); +#[used] +#[link_section = ".requests_end_marker"] +static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new(); + +#[panic_handler] +fn rust_panic(_info: &core::panic::PanicInfo) -> ! { + hcf(); +} + +pub fn hcf() -> ! { + loop { + unsafe { + #[cfg(target_arch = "x86_64")] + asm!("hlt"); + #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] + asm!("wfi"); + #[cfg(target_arch = "loongarch64")] + asm!("idle 0"); + } + } +} + +pub fn boot() -> Result<(), &'static str> { + + if !BASE_REVISION.is_supported() { + return Err("base revision not supported"); + } + + lib_serial::init()?; + arch::x86_64::interrupts::init_idt(); + + + Ok(()) +} \ No newline at end of file diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 9e619b3..552e081 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -1,46 +1,23 @@ #![no_std] #![no_main] -use core::arch::asm; - -use lib_serial::{serial_println, serial_read}; -use lib_ascii::{print, println, WRITER}; - -use limine::request::{RequestsEndMarker, RequestsStartMarker}; -use limine::BaseRevision; - -use lib_framebuffer; - -/// Sets the base revision to the latest revision supported by the crate. -/// See specification for further info. -/// Be sure to mark all limine requests with #[used], otherwise they may be removed by the compiler. -#[used] -// The .requests section allows limine to find the requests faster and more safely. -#[link_section = ".requests"] -static BASE_REVISION: BaseRevision = BaseRevision::new(); - -/// Define the stand and end markers for Limine requests. -#[used] -#[link_section = ".requests_start_marker"] -static _START_MARKER: RequestsStartMarker = RequestsStartMarker::new(); -#[used] -#[link_section = ".requests_end_marker"] -static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new(); +use FoundryOS::{ + println, println_log +}; #[no_mangle] unsafe extern "C" fn kmain() -> ! { // All limine requests must also be referenced in a called function, otherwise they may be // removed by the linker. - assert!(BASE_REVISION.is_supported()); - - if let Err(_) = lib_serial::init() { - loop {} - } + FoundryOS::boot(); let dimensions = lib_ascii::screensize_chars(); let dimensions2 = lib_framebuffer::screensize_px(); - println!("Hello World!"); + println_log!(" [ Initialising ] "); + + x86_64::instructions::interrupts::int3(); + println!("Dimensions: {}x{} (px)", dimensions2.0, dimensions2.1); println!("Dimensions: {}x{} (chars)", dimensions.0, dimensions.1); @@ -63,27 +40,9 @@ unsafe extern "C" fn kmain() -> ! { \\______/ \\______/ \\_/ \\______| "); - for i in 0u8..128 { - print!("{}", i as char); - } - - hcf(); + + FoundryOS::hcf(); } -#[panic_handler] -fn rust_panic(_info: &core::panic::PanicInfo) -> ! { - hcf(); -} -fn hcf() -> ! { - loop { - unsafe { - #[cfg(target_arch = "x86_64")] - asm!("hlt"); - #[cfg(any(target_arch = "aarch64", target_arch = "riscv64"))] - asm!("wfi"); - #[cfg(target_arch = "loongarch64")] - asm!("idle 0"); - } - } -} \ No newline at end of file + diff --git a/script.py b/script.py new file mode 100644 index 0000000..9669c01 --- /dev/null +++ b/script.py @@ -0,0 +1,389 @@ +string = """0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, + 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, + 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, + 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, + 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, + 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, + 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, + 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, + 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, + 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, + 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, + 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, + 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, + 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, + 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, + 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, + 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, + 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, + 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, + 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, + 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, + 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, + 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, + 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, + 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, + 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x0c, + 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, + 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30, + 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, + 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, + 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, + 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, + 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, + 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00, + 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, + 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, + 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x30, 0x30, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, + 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, + 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, + 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, + 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, + 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, + 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, + 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, + 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, + 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, + 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, + 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, + 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, + 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, + 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, + 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, + 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x18, 0x18, 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, + 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, + 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, + 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, + 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xce, + 0x9e, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, + 0x18, 0x30, 0x60, 0xdc, 0x86, 0x0c, 0x18, 0x3e, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, + 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 0x38, 0x6c, + 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, + 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, + 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, + 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, + 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, + 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, + 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, + 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 0x78, + 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xcc, 0x76, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, + 0x0c, 0x06, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, + 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, + 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, + 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, + 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, + 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, + 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, + 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, + 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x0e, + 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, + 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, + 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x3c, + 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, + 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 0x66, 0x66, + 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, + 0x7c, 0x60, 0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 0xd8, 0xd8, + 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, + 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, + 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xf8, 0xc4, 0xcc, 0xde, 0xcc, 0xcc, + 0xcc, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, + 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, + 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, + 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, + 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, + 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, + 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, + 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, + 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, + 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, + 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, + 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, + 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, + 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, + 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, + 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, + 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, + 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, + 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, + 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, + 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, + 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, + 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, + 0x0f, 0x0f, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, + 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, + 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, + 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, + 0xdd, 0x77, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, + 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, + 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, + 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, + 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, + 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, + 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, + 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, + 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, + 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, + 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, + 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, + 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, + 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00""" + +def main(): + newstring = string.replace("\n", "") + newstring = newstring.replace(" ", "") + entries = newstring.split(",") + + output = "" + for i in range(len(entries) // 16): + output += ",".join(entries[i * 16 : (i + 1) * 16]) + f", // {i}\n" + + print(output) From 650f34f354bd2be3ceb5e477189ff1590b55d499 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:08:07 +0000 Subject: [PATCH 12/41] removed redundant script --- script.py | 389 ------------------------------------------------------ 1 file changed, 389 deletions(-) delete mode 100644 script.py diff --git a/script.py b/script.py deleted file mode 100644 index 9669c01..0000000 --- a/script.py +++ /dev/null @@ -1,389 +0,0 @@ -string = """0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, - 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, - 0x81, 0xbd, 0x99, 0x81, 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7e, 0xff, 0xdb, 0xff, 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, 0xfe, 0xfe, 0xfe, 0x7c, - 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, - 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, 0x18, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, - 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, - 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, - 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, - 0x1e, 0x0e, 0x1a, 0x32, 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, - 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, - 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, - 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0e, 0x1e, 0x3e, - 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, - 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xdb, 0xdb, 0xdb, - 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, - 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, 0x0c, 0xc6, 0x7c, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, - 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, - 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x7e, - 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, - 0x0c, 0xfe, 0x0c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x30, 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, - 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c, 0x38, 0x38, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x6c, 0xfe, - 0x6c, 0x6c, 0x6c, 0xfe, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, - 0x7c, 0xc6, 0xc2, 0xc0, 0x7c, 0x06, 0x06, 0x86, 0xc6, 0x7c, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0xc6, 0x0c, 0x18, 0x30, 0x60, - 0xc6, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, - 0x76, 0xdc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, - 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x18, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, 0x0c, - 0x0c, 0x0c, 0x0c, 0x0c, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x66, 0x3c, 0xff, 0x3c, 0x66, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x06, - 0x0c, 0x18, 0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, - 0x18, 0x30, 0x60, 0xc0, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0xc6, 0x06, 0x06, 0x3c, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0c, 0x1c, 0x3c, 0x6c, 0xcc, 0xfe, 0x0c, 0x0c, - 0x0c, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, - 0xfc, 0x06, 0x06, 0x06, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x60, 0xc0, 0xc0, 0xfc, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0x06, 0x06, 0x0c, 0x18, 0x30, 0x30, - 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, - 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x06, 0x06, 0x0c, 0x78, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x18, - 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, - 0x00, 0x00, 0x00, 0x18, 0x18, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, 0x06, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x7e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, - 0x0c, 0x06, 0x0c, 0x18, 0x30, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7c, 0xc6, 0xc6, 0x0c, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xde, 0xde, 0xde, 0xdc, - 0xc0, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, - 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x66, 0x66, 0x66, 0x66, 0xfc, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc0, 0xc2, - 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x6c, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, 0x6c, 0xf8, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0x66, 0x62, 0x68, 0x78, 0x68, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xde, 0xc6, 0xc6, 0x66, 0x3a, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x1e, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xe6, 0x66, 0x66, 0x6c, 0x78, 0x78, 0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xde, 0x7c, 0x0c, 0x0e, 0x00, 0x00, - 0x00, 0x00, 0xfc, 0x66, 0x66, 0x66, 0x7c, 0x6c, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c, 0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38, 0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30, 0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, - 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, - 0x70, 0x38, 0x1c, 0x0e, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x30, 0x30, - 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, - 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x78, - 0x6c, 0x66, 0x66, 0x66, 0x66, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc0, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1c, 0x0c, 0x0c, 0x3c, 0x6c, 0xcc, 0xcc, 0xcc, - 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, - 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0x7c, 0x0c, 0xcc, 0x78, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x6c, - 0x76, 0x66, 0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x0e, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x66, 0x66, 0x3c, 0x00, 0x00, 0x00, 0xe0, 0x60, 0x60, 0x66, - 0x6c, 0x78, 0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6, 0xd6, 0xd6, - 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, - 0x66, 0x66, 0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x7c, 0x60, 0x60, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, - 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x7c, 0x0c, 0x0c, 0x1e, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xdc, 0x76, 0x66, 0x60, 0x60, 0x60, 0xf0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x0c, - 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x30, 0x30, 0xfc, - 0x30, 0x30, 0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x66, - 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, - 0xc6, 0xd6, 0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38, 0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, - 0xcc, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0e, 0x18, 0x18, 0x18, 0x70, 0x18, 0x18, 0x18, 0x18, 0x0e, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x18, 0x18, 0x18, - 0x0e, 0x18, 0x18, 0x18, 0x18, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, - 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x18, 0x18, 0x3c, 0x66, 0x60, 0x60, 0x60, 0x66, 0x3c, - 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, - 0x60, 0x60, 0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x7c, 0xc6, 0x60, 0x38, 0x6c, 0xc6, 0xc6, 0x6c, 0x38, - 0x0c, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x6c, 0x6c, 0x3e, 0x00, - 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8, 0x6c, 0x36, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0x06, 0x06, - 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x00, 0x00, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x70, 0xd8, 0x30, 0x60, 0xc8, 0xf8, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x7c, 0x60, 0x60, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7f, 0xdb, 0xdb, 0xdb, 0x7b, 0x1b, 0x1b, 0x1b, 0x1b, 0x1b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x6c, 0x38, 0x00, - 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xd8, 0x6c, 0x36, 0x6c, 0xd8, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30, 0x66, 0xce, - 0x9e, 0x3e, 0x06, 0x06, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, - 0x18, 0x30, 0x60, 0xdc, 0x86, 0x0c, 0x18, 0x3e, 0x00, 0x00, 0x00, 0x00, - 0x30, 0x30, 0x00, 0x30, 0x30, 0x60, 0xc0, 0xc6, 0xc6, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc6, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xfe, 0xc6, - 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 0x38, 0x6c, - 0xc6, 0xc6, 0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc, 0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0xc2, 0xc0, 0xc0, 0xc0, 0xc2, 0x66, - 0x3c, 0x0c, 0x06, 0x7c, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, - 0x60, 0x7c, 0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, - 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce, 0xc6, 0xc6, 0xc6, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xc6, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x78, 0xcc, 0xcc, 0xcc, 0xd8, 0xcc, 0xc6, 0xc6, 0xc6, 0xcc, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, - 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0x78, - 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, - 0x38, 0x6c, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x78, 0x0c, 0x7c, 0xcc, 0xcc, - 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0x38, 0x00, 0x78, - 0x0c, 0x7c, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xcc, 0x76, 0x36, 0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x60, 0x60, 0x66, 0x3c, - 0x0c, 0x06, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, - 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, - 0x18, 0x30, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xfe, 0xc0, 0xc0, - 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, - 0xc6, 0xfe, 0xc0, 0xc0, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, - 0x30, 0x18, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x66, 0x00, 0x38, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, 0x00, 0xdc, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0x7c, - 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, - 0x30, 0x60, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0x7c, - 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x00, 0x7e, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x60, 0x30, 0x18, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x30, 0x60, 0x00, 0xcc, - 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, - 0x78, 0xcc, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, - 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x00, 0x00, 0xc6, - 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0x78, 0x00, 0x00, 0x0e, - 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, - 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc6, 0xc6, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, - 0xc0, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, - 0xc6, 0xfe, 0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xfe, 0xc6, 0x60, 0x30, 0x18, 0x30, 0x60, 0xc6, 0xfe, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x18, 0x3c, 0x66, 0x66, 0x66, 0x3c, - 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, - 0xc6, 0x6c, 0x6c, 0x6c, 0x6c, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x76, 0xdc, 0xd8, 0xd8, 0xd8, 0xdc, 0x76, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1e, 0x30, 0x18, 0x0c, 0x3e, 0x66, 0x66, 0x66, - 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x30, 0x60, 0x60, - 0x7c, 0x60, 0x60, 0x60, 0x30, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xd8, 0xd8, 0xd8, 0xd8, - 0xd8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0xdc, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x06, 0x7e, 0xdb, 0xdb, 0xf3, 0x7e, 0x60, 0xc0, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, - 0x6c, 0x6c, 0x6c, 0x6c, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xf8, 0xcc, 0xcc, 0xf8, 0xc4, 0xcc, 0xde, 0xcc, 0xcc, - 0xcc, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, - 0x60, 0xfe, 0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x0c, 0xfe, 0x0c, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe, 0x6c, 0x28, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, 0x18, 0x18, 0x7e, 0x3c, - 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x7e, 0x18, - 0x18, 0x18, 0x7e, 0x3c, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0f, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0xec, 0x6c, 0x6c, - 0x3c, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, - 0xdb, 0xdb, 0xdb, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0, 0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, - 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, - 0xdc, 0x00, 0x76, 0xdc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x18, 0x30, 0x60, 0x30, 0x18, 0x0c, - 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x18, 0x0c, - 0x06, 0x0c, 0x18, 0x30, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x38, 0x6c, 0xc6, 0xc6, 0xc6, 0xfe, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xc0, 0xc0, 0xc0, - 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x1b, 0x1b, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xd8, 0xd8, 0xd8, 0x70, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, - 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, - 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x30, 0x37, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, - 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06, 0xf6, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, - 0x18, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x3f, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, - 0x18, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xfe, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x1f, - 0x18, 0x1f, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x37, 0x30, 0x37, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x18, 0x18, 0x18, 0x18, 0x18, 0xf8, - 0x18, 0xf8, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf6, 0x06, 0xf6, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, - 0x00, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xf7, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, - 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xff, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0xff, - 0x18, 0xff, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xf7, 0x00, 0xf7, 0x36, 0x36, - 0x36, 0x36, 0x36, 0x36, 0x36, 0x36, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, - 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0x0f, 0x0f, - 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, - 0x0f, 0x0f, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, - 0x11, 0x44, 0x11, 0x44, 0x11, 0x44, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, - 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0xdd, 0x77, - 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, - 0xdd, 0x77, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, 0x7c, - 0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0xfe, 0xfe, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c, 0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfe, 0xf8, 0xf0, 0xe0, - 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, - 0x7c, 0x7c, 0x38, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, - 0x06, 0x0e, 0x1e, 0x3e, 0xfe, 0x3e, 0x1e, 0x0e, 0x06, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x42, 0x42, 0x66, - 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xe7, 0xc3, 0xc3, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xc3, 0x99, 0xbd, 0xbd, 0x99, 0xc3, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x00, 0x00, 0x7e, 0x81, 0xa5, 0x81, 0x81, 0xbd, 0x99, 0x81, - 0x81, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0xff, 0xdb, 0xff, - 0xff, 0xc3, 0xe7, 0xff, 0xff, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x18, 0xdb, 0x3c, 0xe7, 0x3c, 0xdb, 0x18, 0x18, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18, 0x7e, - 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x0e, 0x1a, 0x32, - 0x78, 0xcc, 0xcc, 0xcc, 0xcc, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x18, 0x18, 0x3c, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x3c, 0x3c, 0xe7, 0xe7, 0xe7, 0x18, - 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0xfe, - 0xfe, 0xfe, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3f, 0x33, 0x3f, 0x30, 0x30, 0x30, 0x30, 0x70, - 0xf0, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x63, 0x7f, 0x63, - 0x63, 0x63, 0x63, 0x67, 0xe7, 0xe6, 0xc0, 0x00, 0x00, 0x00""" - -def main(): - newstring = string.replace("\n", "") - newstring = newstring.replace(" ", "") - entries = newstring.split(",") - - output = "" - for i in range(len(entries) // 16): - output += ",".join(entries[i * 16 : (i + 1) * 16]) + f", // {i}\n" - - print(output) From ee8dae4981a1f39c41594cfe66956d9f5656a52b Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:12:15 +0000 Subject: [PATCH 13/41] added rust.yml workflow, probably wont work. --- .gitea/workflows/rust.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .gitea/workflows/rust.yml diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml new file mode 100644 index 0000000..438a555 --- /dev/null +++ b/.gitea/workflows/rust.yml @@ -0,0 +1,12 @@ +on: [push, pull_request] + +name: Continuous integration + +jobs: + build: + name: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - run: cargo build \ No newline at end of file From 11d63535e905b4e37fb33d3662c0540d213f7e7e Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:27:08 +0000 Subject: [PATCH 14/41] added submodule cloning to rust.yml --- .gitea/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml index 438a555..430c46d 100644 --- a/.gitea/workflows/rust.yml +++ b/.gitea/workflows/rust.yml @@ -8,5 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + submodules: "true" - uses: actions-rust-lang/setup-rust-toolchain@v1 - run: cargo build \ No newline at end of file From af3215d887f683e0eb7541c6ddccbd213ddf1f26 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:28:31 +0000 Subject: [PATCH 15/41] changed order of steps in rust.yml --- .gitea/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml index 430c46d..478287d 100644 --- a/.gitea/workflows/rust.yml +++ b/.gitea/workflows/rust.yml @@ -7,8 +7,8 @@ jobs: name: build runs-on: ubuntu-latest steps: + - uses: actions-rust-lang/setup-rust-toolchain@v1 - uses: actions/checkout@v4 with: submodules: "true" - - uses: actions-rust-lang/setup-rust-toolchain@v1 - run: cargo build \ No newline at end of file From 68c3d2fa0ead852217e00595ddb19055648f4ab8 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 01:55:36 +0000 Subject: [PATCH 16/41] workflow changes --- .gitea/workflows/rust.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml index 478287d..077e6ec 100644 --- a/.gitea/workflows/rust.yml +++ b/.gitea/workflows/rust.yml @@ -8,7 +8,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + target: x86_64-unknown-none + components: rust-src, llvm-tools-preview - uses: actions/checkout@v4 with: - submodules: "true" + submodules: true - run: cargo build \ No newline at end of file From a88059c5ff31724a55c7415c2ca5413f78068bc6 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 02:13:38 +0000 Subject: [PATCH 17/41] workflow builds nightly --- .gitea/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml index 077e6ec..4c85fad 100644 --- a/.gitea/workflows/rust.yml +++ b/.gitea/workflows/rust.yml @@ -11,6 +11,7 @@ jobs: with: target: x86_64-unknown-none components: rust-src, llvm-tools-preview + toolchain: nightly - uses: actions/checkout@v4 with: submodules: true From 3aca8fd72057fd414ed439e8ac2143b0d28e5d4e Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Sat, 22 Feb 2025 02:41:23 +0000 Subject: [PATCH 18/41] Add some docs on building, bumped limine to latest version No issues occurred having bumped the version, all seems well. --- README.md | 20 ++++++++++++++++++++ scripts/run.sh | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 505c9e2..e013c0a 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # FoundryOS +## Cloning and building + +Here are some simple steps to get started: + +```sh +# If you have not yet cloned the repo: +git clone --recurse-submodules https://git.zxq5.dev/OsDev/FoundryOS.git +# If you already cloned the repo: +git submodule update --init --recursive + +cargo build +# This will build the binaries if required - no need to call cargo build. +cargo run +``` + +### Build dependencies + +* jq: checks whether the app is to be run in debugging mode. +* libisoburn: creates ISO images to be booted from. +* qemu: to run the kernel. diff --git a/scripts/run.sh b/scripts/run.sh index 2cf05ad..79359bf 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -85,7 +85,7 @@ mkdir -p "$iso_root/EFI/BOOT" if [ ! -d "$build_dir/limine" ]; then compiling "limine bootloader" cd "$build_dir" - git clone https://github.com/limine-bootloader/limine.git --branch=v8.x-binary --depth=1 "$build_dir/limine" || error "failed to clone limine" + git clone https://github.com/limine-bootloader/limine.git --branch=v9.x-binary --depth=1 "$build_dir/limine" || error "failed to clone limine" make -C "$build_dir/limine" || error "failed to build limine" cd "$project_root" fi From f5f5aeb8dc2d32e7d47bd8414fab80fe99fcfbbc Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Sat, 22 Feb 2025 03:09:46 +0000 Subject: [PATCH 19/41] Formatting changes, called 'cargo fmt' --- kernel/build.rs | 4 ++-- kernel/src/arch/mod.rs | 2 +- kernel/src/arch/x86_64/interrupts.rs | 6 +----- kernel/src/arch/x86_64/mod.rs | 2 +- kernel/src/lib.rs | 10 +++------- kernel/src/main.rs | 14 +++++--------- lib/lib_application | 2 +- lib/lib_ascii | 2 +- lib/lib_framebuffer | 2 +- lib/lib_serial | 2 +- 10 files changed, 17 insertions(+), 29 deletions(-) diff --git a/kernel/build.rs b/kernel/build.rs index a9b7914..9553c96 100644 --- a/kernel/build.rs +++ b/kernel/build.rs @@ -1,10 +1,10 @@ +use cc; use std::process::Command; use std::{env, path::Path}; -use cc; fn main() { // Tell cargo to rerun if these files change println!("cargo:rerun-if-changed=src"); println!("cargo:rerun-if-changed=linker.ld"); println!("cargo:rerun-if-changed=../config/limine.conf"); -} \ No newline at end of file +} diff --git a/kernel/src/arch/mod.rs b/kernel/src/arch/mod.rs index 0bffdbe..2a99bf5 100644 --- a/kernel/src/arch/mod.rs +++ b/kernel/src/arch/mod.rs @@ -1 +1 @@ -pub mod x86_64; \ No newline at end of file +pub mod x86_64; diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs index 56a0b21..9f4d82a 100644 --- a/kernel/src/arch/x86_64/interrupts.rs +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -9,14 +9,10 @@ static IDT: Lazy = Lazy::new(|| { idt }); - pub fn init_idt() { IDT.load(); } -extern "x86-interrupt" fn breakpoint_handler( - stack_frame: InterruptStackFrame -) { +extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) { println_log!("Exception: Breakpoint\n{:#?}", stack_frame); } - diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs index 4c09fa4..136e70b 100644 --- a/kernel/src/arch/x86_64/mod.rs +++ b/kernel/src/arch/x86_64/mod.rs @@ -1 +1 @@ -pub mod interrupts; \ No newline at end of file +pub mod interrupts; diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index 78dd3ba..3ea6f29 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,19 +1,17 @@ #![no_std] - #![feature(abi_x86_interrupt)] use core::arch::asm; use limine::request::{RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; -pub use lib_serial::{serial_print, serial_println, serial_read}; pub use lib_ascii::{print, print_log, println, println_log, WRITER}; +pub use lib_serial::{serial_print, serial_println, serial_read}; mod arch; use lib_framebuffer; - /// Sets the base revision to the latest revision supported by the crate. /// See specification for further info. /// Be sure to mark all limine requests with #[used], otherwise they may be removed by the compiler. @@ -49,14 +47,12 @@ pub fn hcf() -> ! { } pub fn boot() -> Result<(), &'static str> { - if !BASE_REVISION.is_supported() { return Err("base revision not supported"); } lib_serial::init()?; arch::x86_64::interrupts::init_idt(); - - + Ok(()) -} \ No newline at end of file +} diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 552e081..5e64b54 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -1,9 +1,7 @@ #![no_std] #![no_main] -use FoundryOS::{ - println, println_log -}; +use FoundryOS::{println, println_log}; #[no_mangle] unsafe extern "C" fn kmain() -> ! { @@ -21,7 +19,8 @@ unsafe extern "C" fn kmain() -> ! { println!("Dimensions: {}x{} (px)", dimensions2.0, dimensions2.1); println!("Dimensions: {}x{} (chars)", dimensions.0, dimensions.1); - println!(" + println!( + " $$$$$$$$\\ $$\\ $$ _____| $$ | $$ | $$$$$$\\ $$\\ $$\\ $$$$$$$\\ $$$$$$$ | $$$$$$\\ $$\\ $$\\ @@ -38,11 +37,8 @@ unsafe extern "C" fn kmain() -> ! { $$ | $$ |$$\\ $$ | \\$$$ / $$ | $$$$$$ |\\$$$$$$ | \\$ / $$$$$$\\ \\______/ \\______/ \\_/ \\______| - "); + " + ); - FoundryOS::hcf(); } - - - diff --git a/lib/lib_application b/lib/lib_application index df1cbd1..4b1c606 160000 --- a/lib/lib_application +++ b/lib/lib_application @@ -1 +1 @@ -Subproject commit df1cbd1170723ad75045052dec5b2641fb154591 +Subproject commit 4b1c60676a2f67c2f95139ef2820238cdcbbf19e diff --git a/lib/lib_ascii b/lib/lib_ascii index fefe217..d48792e 160000 --- a/lib/lib_ascii +++ b/lib/lib_ascii @@ -1 +1 @@ -Subproject commit fefe217980e5535bfb9de4de1dbc84db3def93ae +Subproject commit d48792ecd011f88acb84e93e2e2ba33ac2598a72 diff --git a/lib/lib_framebuffer b/lib/lib_framebuffer index c515b89..5355327 160000 --- a/lib/lib_framebuffer +++ b/lib/lib_framebuffer @@ -1 +1 @@ -Subproject commit c515b8913625728924cef92993cb65aa03e2b1c5 +Subproject commit 53553278d11e798f8dc770b9f5efe50d9b737c68 diff --git a/lib/lib_serial b/lib/lib_serial index 92032eb..6731ed5 160000 --- a/lib/lib_serial +++ b/lib/lib_serial @@ -1 +1 @@ -Subproject commit 92032eb5b400fe1afd851dfd613e6d98f04eda40 +Subproject commit 6731ed5ef601201f746946f4c0eea90050414f2a From d12160c5d070ee0819054a9a515ac0a75b2bc6ac Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:16:13 +0000 Subject: [PATCH 20/41] setup TSS --- kernel/src/arch/x86_64/gdt.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 kernel/src/arch/x86_64/gdt.rs diff --git a/kernel/src/arch/x86_64/gdt.rs b/kernel/src/arch/x86_64/gdt.rs new file mode 100644 index 0000000..bf4c036 --- /dev/null +++ b/kernel/src/arch/x86_64/gdt.rs @@ -0,0 +1,18 @@ +use x86_64::{structures::tss::TaskStateSegment, VirtAddr}; + +use spin::Lazy; + +pub const DOUBLE_FAULT_1ST_INDEX: u16 = 0; + +static TSS: Lazy = Lazy::new(|| { + let mut tss = TaskStateSegment::new(); + tss.interrupt_stack_table[DOUBLE_FAULT_1ST_INDEX as usize] = { + const STACK_SIZE: usize = 4096 * 8; + static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE]; + + let stack_start = VirtAddr::from_ptr(&raw const STACK); + let stack_end = stack_start + STACK_SIZE.try_into().unwrap(); + stack_end + }; + tss +}); From 2ee21dea05e53c81cffdc5049fa1c8ccd225bd5e Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:19:05 +0000 Subject: [PATCH 21/41] did interrupts stuff --- Cargo.lock | 10 ++++ Cargo.toml | 2 +- kernel/Cargo.toml | 1 + kernel/src/arch/x86_64/interrupts.rs | 79 +++++++++++++++++++++++++++- kernel/src/arch/x86_64/mod.rs | 4 ++ kernel/src/lib.rs | 6 +++ kernel/src/main.rs | 11 +++- lib/lib_application | 2 +- lib/lib_ascii | 2 +- lib/lib_serial | 2 +- 10 files changed, 112 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4d3f2cc..d36daaf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,7 @@ dependencies = [ "lib_framebuffer", "lib_serial", "limine", + "pic8259", "spin", "x86_64", ] @@ -104,6 +105,15 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "pic8259" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62d9a86c292b165f757e47e7fd66855def189b2564609bc4203727b27c33db22" +dependencies = [ + "x86_64", +] + [[package]] name = "rustversion" version = "1.0.19" diff --git a/Cargo.toml b/Cargo.toml index 0d17198..c740bdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ incremental = false codegen-units = 1 [profile.release] -opt-level = "z" +opt-level = 3 debug = false debug-assertions = false overflow-checks = false diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 2619042..1b94af6 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -10,6 +10,7 @@ lib_serial = { path = "../lib/lib_serial" } lib_ascii = { path = "../lib/lib_ascii" } x86_64 = "0.15.2" spin = "0.9.8" +pic8259 = "0.11.0" [build-dependencies] cc = "1.2.14" diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs index 9f4d82a..234915f 100644 --- a/kernel/src/arch/x86_64/interrupts.rs +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -1,18 +1,95 @@ use lib_ascii::println_log; +use lib_serial::serial_println; +use x86_64::instructions::port::Port; use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; -use spin::Lazy; +use pic8259::ChainedPics; +use spin::{Lazy, Mutex}; static IDT: Lazy = Lazy::new(|| { let mut idt = InterruptDescriptorTable::new(); idt.breakpoint.set_handler_fn(breakpoint_handler); + idt.double_fault.set_handler_fn(double_fault_handler); + idt.general_protection_fault + .set_handler_fn(general_protection_fault_handler); + + idt[InterruptIndex::Timer.as_u8()].set_handler_fn(timer_interrupt_handler); + idt[InterruptIndex::Keyboard.as_u8()].set_handler_fn(keyboard_interrupt_handler); idt }); +<<<<<<< Updated upstream +======= +pub const PIC_1_OFFSET: u8 = 32; +pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8; + +pub static PICS: Mutex = + Mutex::new(unsafe { ChainedPics::new(PIC_1_OFFSET, PIC_2_OFFSET) }); + +#[derive(Debug, Clone, Copy)] +#[repr(u8)] +pub enum InterruptIndex { + Timer = PIC_1_OFFSET, + Keyboard, +} + +impl InterruptIndex { + fn as_u8(self) -> u8 { + self as u8 + } + + fn _as_usize(self) -> usize { + usize::from(self.as_u8()) + } +} + +>>>>>>> Stashed changes pub fn init_idt() { IDT.load(); + unsafe { + PICS.lock().initialize(); + PICS.lock().write_masks(0xfc, 0xff); + } } extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) { +<<<<<<< Updated upstream println_log!("Exception: Breakpoint\n{:#?}", stack_frame); } +======= + serial_println!("Exception: Breakpoint\n{:#?}", stack_frame); + println_log!("Exception: Breakpoint\n{:#?}", stack_frame); +} + +extern "x86-interrupt" fn general_protection_fault_handler( + stack_frame: InterruptStackFrame, + _error_code: u64, +) { + serial_println!("Exception: General Protection Fault\n{:#?}", stack_frame); + panic!("Exception: General Protection Fault\n{:#?}", stack_frame); +} + +extern "x86-interrupt" fn double_fault_handler( + stack_frame: InterruptStackFrame, + _error_code: u64, +) -> ! { + serial_println!("Exception: Double Fault\n{:#?}", stack_frame); + panic!("Exception: Double Fault\n{:#?}", stack_frame); +} + +extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStackFrame) { + let mut port = Port::new(0x60); + let _scancode: u8 = unsafe { port.read() }; + unsafe { + PICS.lock() + .notify_end_of_interrupt(InterruptIndex::Keyboard.as_u8()); + } +} + +extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFrame) { + unsafe { + PICS.lock() + .notify_end_of_interrupt(InterruptIndex::Timer.as_u8()); + } +} +>>>>>>> Stashed changes diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs index 136e70b..7bd6bd6 100644 --- a/kernel/src/arch/x86_64/mod.rs +++ b/kernel/src/arch/x86_64/mod.rs @@ -1 +1,5 @@ +<<<<<<< Updated upstream +======= +pub mod gdt; +>>>>>>> Stashed changes pub mod interrupts; diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index 3ea6f29..c2b3037 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,6 +1,7 @@ #![no_std] #![feature(abi_x86_interrupt)] +use arch::x86_64::interrupts; use core::arch::asm; use limine::request::{RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; @@ -54,5 +55,10 @@ pub fn boot() -> Result<(), &'static str> { lib_serial::init()?; arch::x86_64::interrupts::init_idt(); +<<<<<<< Updated upstream +======= + x86_64::instructions::interrupts::enable(); + +>>>>>>> Stashed changes Ok(()) } diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 5e64b54..6dbd439 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -14,8 +14,6 @@ unsafe extern "C" fn kmain() -> ! { let dimensions2 = lib_framebuffer::screensize_px(); println_log!(" [ Initialising ] "); - x86_64::instructions::interrupts::int3(); - println!("Dimensions: {}x{} (px)", dimensions2.0, dimensions2.1); println!("Dimensions: {}x{} (chars)", dimensions.0, dimensions.1); @@ -39,6 +37,15 @@ unsafe extern "C" fn kmain() -> ! { \\______/ \\______/ \\_/ \\______| " ); +<<<<<<< Updated upstream +======= + + // for i in 0..100000 { + // println!("{}", i); + // } + + loop {} +>>>>>>> Stashed changes FoundryOS::hcf(); } diff --git a/lib/lib_application b/lib/lib_application index 4b1c606..df1cbd1 160000 --- a/lib/lib_application +++ b/lib/lib_application @@ -1 +1 @@ -Subproject commit 4b1c60676a2f67c2f95139ef2820238cdcbbf19e +Subproject commit df1cbd1170723ad75045052dec5b2641fb154591 diff --git a/lib/lib_ascii b/lib/lib_ascii index d48792e..fefe217 160000 --- a/lib/lib_ascii +++ b/lib/lib_ascii @@ -1 +1 @@ -Subproject commit d48792ecd011f88acb84e93e2e2ba33ac2598a72 +Subproject commit fefe217980e5535bfb9de4de1dbc84db3def93ae diff --git a/lib/lib_serial b/lib/lib_serial index 6731ed5..a3b0bf0 160000 --- a/lib/lib_serial +++ b/lib/lib_serial @@ -1 +1 @@ -Subproject commit 6731ed5ef601201f746946f4c0eea90050414f2a +Subproject commit a3b0bf0bdbe60c53b930ff13d251e50ed8895f78 From ab0ec3509490431368cad1ba5fc7d493740c3b79 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:24:48 +0000 Subject: [PATCH 22/41] updated submodules --- lib/lib_application | 2 +- lib/lib_ascii | 2 +- lib/lib_serial | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lib_application b/lib/lib_application index df1cbd1..4b1c606 160000 --- a/lib/lib_application +++ b/lib/lib_application @@ -1 +1 @@ -Subproject commit df1cbd1170723ad75045052dec5b2641fb154591 +Subproject commit 4b1c60676a2f67c2f95139ef2820238cdcbbf19e diff --git a/lib/lib_ascii b/lib/lib_ascii index fefe217..ba43834 160000 --- a/lib/lib_ascii +++ b/lib/lib_ascii @@ -1 +1 @@ -Subproject commit fefe217980e5535bfb9de4de1dbc84db3def93ae +Subproject commit ba43834e3ead8a242761b3d769bd959aeb126ff5 diff --git a/lib/lib_serial b/lib/lib_serial index a3b0bf0..ff197cf 160000 --- a/lib/lib_serial +++ b/lib/lib_serial @@ -1 +1 @@ -Subproject commit a3b0bf0bdbe60c53b930ff13d251e50ed8895f78 +Subproject commit ff197cfc56e8c50314f74465bb92442e3a39a89c From ae82e9c24b22fd3b2c33eda8e8be3fe92a89eb17 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:27:08 +0000 Subject: [PATCH 23/41] idk --- kernel/src/arch/x86_64/mod.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs index 7bd6bd6..341df6d 100644 --- a/kernel/src/arch/x86_64/mod.rs +++ b/kernel/src/arch/x86_64/mod.rs @@ -1,5 +1,4 @@ -<<<<<<< Updated upstream -======= + pub mod gdt; ->>>>>>> Stashed changes + pub mod interrupts; From bb5bf9115b484c56be2278169dbd9c70d78b3d08 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:29:33 +0000 Subject: [PATCH 24/41] fixed weird merge issues --- kernel/src/arch/x86_64/interrupts.rs | 11 +++-------- kernel/src/lib.rs | 3 --- kernel/src/main.rs | 3 --- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs index 234915f..093a85c 100644 --- a/kernel/src/arch/x86_64/interrupts.rs +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -18,8 +18,7 @@ static IDT: Lazy = Lazy::new(|| { idt }); -<<<<<<< Updated upstream -======= + pub const PIC_1_OFFSET: u8 = 32; pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8; @@ -43,7 +42,7 @@ impl InterruptIndex { } } ->>>>>>> Stashed changes + pub fn init_idt() { IDT.load(); unsafe { @@ -53,10 +52,6 @@ pub fn init_idt() { } extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) { -<<<<<<< Updated upstream - println_log!("Exception: Breakpoint\n{:#?}", stack_frame); -} -======= serial_println!("Exception: Breakpoint\n{:#?}", stack_frame); println_log!("Exception: Breakpoint\n{:#?}", stack_frame); } @@ -92,4 +87,4 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFr .notify_end_of_interrupt(InterruptIndex::Timer.as_u8()); } } ->>>>>>> Stashed changes + diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index c2b3037..c36854e 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -55,10 +55,7 @@ pub fn boot() -> Result<(), &'static str> { lib_serial::init()?; arch::x86_64::interrupts::init_idt(); -<<<<<<< Updated upstream -======= x86_64::instructions::interrupts::enable(); ->>>>>>> Stashed changes Ok(()) } diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 6dbd439..06584d3 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -37,15 +37,12 @@ unsafe extern "C" fn kmain() -> ! { \\______/ \\______/ \\_/ \\______| " ); -<<<<<<< Updated upstream -======= // for i in 0..100000 { // println!("{}", i); // } loop {} ->>>>>>> Stashed changes FoundryOS::hcf(); } From 5c9717d384e6b279d6d2116fc13160edf12f547b Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:33:19 +0000 Subject: [PATCH 25/41] cargo fmt --- kernel/src/arch/x86_64/interrupts.rs | 3 --- kernel/src/arch/x86_64/mod.rs | 1 - 2 files changed, 4 deletions(-) diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs index 093a85c..160cf20 100644 --- a/kernel/src/arch/x86_64/interrupts.rs +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -18,7 +18,6 @@ static IDT: Lazy = Lazy::new(|| { idt }); - pub const PIC_1_OFFSET: u8 = 32; pub const PIC_2_OFFSET: u8 = PIC_1_OFFSET + 8; @@ -42,7 +41,6 @@ impl InterruptIndex { } } - pub fn init_idt() { IDT.load(); unsafe { @@ -87,4 +85,3 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFr .notify_end_of_interrupt(InterruptIndex::Timer.as_u8()); } } - diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs index 341df6d..cd849ac 100644 --- a/kernel/src/arch/x86_64/mod.rs +++ b/kernel/src/arch/x86_64/mod.rs @@ -1,4 +1,3 @@ - pub mod gdt; pub mod interrupts; From 969756c6912b6e9748780c6543bf72dc3e86cc8b Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Sat, 22 Feb 2025 03:33:32 +0000 Subject: [PATCH 26/41] Suppress erroneous build errors from rust-analyzer. --- .vscode/settings.json | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c6e307c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "rust-analyzer.cargo.allTargets": false, + "rust-analyzer.cargo.target": "x86_64-kernel", +} \ No newline at end of file From b4d0b05e132ac28b879d5360a07ae156b02f834f Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:35:02 +0000 Subject: [PATCH 27/41] updated submodule --- lib/lib_serial | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib_serial b/lib/lib_serial index ff197cf..ed2fa6b 160000 --- a/lib/lib_serial +++ b/lib/lib_serial @@ -1 +1 @@ -Subproject commit ff197cfc56e8c50314f74465bb92442e3a39a89c +Subproject commit ed2fa6b50102607d33973c1851a0ec8c895ed4fa From 3a232c80231c88cb582e378ce0e0bafa1c4ab503 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:39:22 +0000 Subject: [PATCH 28/41] Merge remote-tracking branch 'refs/remotes/origin/dev' into dev (and add cargo fmt on save) --- .vscode/settings.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c6e307c..c7cc8ca 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,9 @@ { "rust-analyzer.cargo.allTargets": false, "rust-analyzer.cargo.target": "x86_64-kernel", -} \ No newline at end of file + "[rust]": { + "editor.defaultFormatter": "rust-lang.rust-analyzer", + "editor.formatOnSave": true + } +} + From 5b1f04c1da2c0ceed21ecc437801106a4d0bf724 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:47:54 +0000 Subject: [PATCH 29/41] changed some code order --- kernel/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 06584d3..0d6fe97 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -8,11 +8,11 @@ unsafe extern "C" fn kmain() -> ! { // All limine requests must also be referenced in a called function, otherwise they may be // removed by the linker. + println_log!(" [ Initialising ] "); FoundryOS::boot(); let dimensions = lib_ascii::screensize_chars(); let dimensions2 = lib_framebuffer::screensize_px(); - println_log!(" [ Initialising ] "); println!("Dimensions: {}x{} (px)", dimensions2.0, dimensions2.1); println!("Dimensions: {}x{} (chars)", dimensions.0, dimensions.1); From 90faace7a22984384ec118dc3451f6bccf5f05c0 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:50:13 +0000 Subject: [PATCH 30/41] changed name to snake case --- Cargo.lock | 28 ++++++++++++++-------------- kernel/Cargo.toml | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d36daaf..e7b8c2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,20 +2,6 @@ # It is not intended for manual editing. version = 4 -[[package]] -name = "FoundryOS" -version = "0.1.0" -dependencies = [ - "cc", - "lib_ascii", - "lib_framebuffer", - "lib_serial", - "limine", - "pic8259", - "spin", - "x86_64", -] - [[package]] name = "autocfg" version = "1.4.0" @@ -43,6 +29,20 @@ dependencies = [ "shlex", ] +[[package]] +name = "foundry_os" +version = "0.1.0" +dependencies = [ + "cc", + "lib_ascii", + "lib_framebuffer", + "lib_serial", + "limine", + "pic8259", + "spin", + "x86_64", +] + [[package]] name = "lazy_static" version = "1.5.0" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 1b94af6..4759c3f 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "FoundryOS" +name = "foundry_os" version = "0.1.0" edition = "2021" From 28afe25ccaaeaf06162c1064f82db252c28691bc Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 03:52:32 +0000 Subject: [PATCH 31/41] check boot was successful else panic --- kernel/src/main.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 0d6fe97..5c5ddbf 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -1,7 +1,7 @@ #![no_std] #![no_main] -use FoundryOS::{println, println_log}; +use foundry_os::{println, println_log}; #[no_mangle] unsafe extern "C" fn kmain() -> ! { @@ -9,7 +9,9 @@ unsafe extern "C" fn kmain() -> ! { // removed by the linker. println_log!(" [ Initialising ] "); - FoundryOS::boot(); + if let Err(err) = foundry_os::boot() { + panic!("{}", err); + } let dimensions = lib_ascii::screensize_chars(); let dimensions2 = lib_framebuffer::screensize_px(); @@ -38,11 +40,5 @@ unsafe extern "C" fn kmain() -> ! { " ); - // for i in 0..100000 { - // println!("{}", i); - // } - loop {} - - FoundryOS::hcf(); } From c1a8afb8367d0819bfd80e127f51f30c58fdf777 Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Sat, 22 Feb 2025 03:59:28 +0000 Subject: [PATCH 32/41] Formatted random JSON file whoops --- Cargo.toml | 8 ++++---- kernel/x86_64-kernel.json | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c740bdd..972ad1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,11 @@ [workspace] -members = [ +members = [ "lib/lib_framebuffer", "lib/lib_serial", "lib/lib_ascii", - "kernel" -, "lib/lib_application"] + "kernel", + "lib/lib_application", +] resolver = "2" [workspace.package] @@ -28,4 +29,3 @@ overflow-checks = false lto = true incremental = false codegen-units = 1 - diff --git a/kernel/x86_64-kernel.json b/kernel/x86_64-kernel.json index 8f7231a..7b3dc4e 100644 --- a/kernel/x86_64-kernel.json +++ b/kernel/x86_64-kernel.json @@ -24,7 +24,8 @@ "--no-pie", "--gc-sections", "--build-id=none", - "-z", "max-page-size=0x1000" + "-z", + "max-page-size=0x1000" ] } } From 2b2219f5be07d733aa60b6e26fb851c8b65d30da Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Sat, 22 Feb 2025 04:00:37 +0000 Subject: [PATCH 33/41] Update submodules --- lib/lib_ascii | 2 +- lib/lib_serial | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lib_ascii b/lib/lib_ascii index ba43834..1ae956e 160000 --- a/lib/lib_ascii +++ b/lib/lib_ascii @@ -1 +1 @@ -Subproject commit ba43834e3ead8a242761b3d769bd959aeb126ff5 +Subproject commit 1ae956efa44d7ebb009ce23ee917a76cb4df96ca diff --git a/lib/lib_serial b/lib/lib_serial index ed2fa6b..813fc0b 160000 --- a/lib/lib_serial +++ b/lib/lib_serial @@ -1 +1 @@ -Subproject commit ed2fa6b50102607d33973c1851a0ec8c895ed4fa +Subproject commit 813fc0bfa3a14069c5a7ee18c1d70a025d12f48d From 40ad5dbbf4f706f6c1aa9a144fe71cee29f6ecd3 Mon Sep 17 00:00:00 2001 From: Jacob Hinchliffe Date: Sat, 22 Feb 2025 05:00:18 +0000 Subject: [PATCH 34/41] Add page fault handler that does nothing, I am tired --- kernel/src/arch/x86_64/interrupts.rs | 16 +++++++- kernel/src/arch/x86_64/memmap.rs | 56 ++++++++++++++++++++++++++++ kernel/src/lib.rs | 3 -- 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 kernel/src/arch/x86_64/memmap.rs diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs index 160cf20..cffb882 100644 --- a/kernel/src/arch/x86_64/interrupts.rs +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -1,7 +1,8 @@ use lib_ascii::println_log; use lib_serial::serial_println; use x86_64::instructions::port::Port; -use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; +use x86_64::registers::control::Cr2; +use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame, PageFaultErrorCode}; use pic8259::ChainedPics; use spin::{Lazy, Mutex}; @@ -12,6 +13,7 @@ static IDT: Lazy = Lazy::new(|| { idt.double_fault.set_handler_fn(double_fault_handler); idt.general_protection_fault .set_handler_fn(general_protection_fault_handler); + idt.page_fault.set_handler_fn(page_fault_handler); idt[InterruptIndex::Timer.as_u8()].set_handler_fn(timer_interrupt_handler); idt[InterruptIndex::Keyboard.as_u8()].set_handler_fn(keyboard_interrupt_handler); @@ -85,3 +87,15 @@ extern "x86-interrupt" fn timer_interrupt_handler(_stack_frame: InterruptStackFr .notify_end_of_interrupt(InterruptIndex::Timer.as_u8()); } } + +extern "x86-interrupt" fn page_fault_handler( + stack_frame: InterruptStackFrame, + error_code: PageFaultErrorCode, +) { + serial_println!("Exception: Page Fault"); + serial_println!("Accessed Address: {:?}", Cr2::read()); + serial_println!("Error Code: {:?}", error_code); + serial_println!("{:#?}", stack_frame); + + crate::hcf(); +} diff --git a/kernel/src/arch/x86_64/memmap.rs b/kernel/src/arch/x86_64/memmap.rs new file mode 100644 index 0000000..1b0cbbb --- /dev/null +++ b/kernel/src/arch/x86_64/memmap.rs @@ -0,0 +1,56 @@ +//! Sets up a memory map using Limine. + +use limine::{ + request::{HhdmRequest, KernelAddressRequest, MemoryMapRequest}, + response::MemoryMapResponse, +}; +use spin::Lazy; + +#[used] +#[link_section = ".requests"] +static MEMORY_MAP_REQUEST: MemoryMapRequest = MemoryMapRequest::new(); + +#[used] +#[link_section = ".requests"] +static HIGHER_HALF_DIRECT_MAP_REQUEST: HhdmRequest = HhdmRequest::new(); + +/// ```rs +/// let virt_addr = phys_addr + offset; +/// let phys_addr = virt_addr - offset; // (given VA is in the HHDM). Do not use for executable code. +/// ``` +pub static PHYSICAL_MEMORY_OFFSET: Lazy = Lazy::new(|| { + HIGHER_HALF_DIRECT_MAP_REQUEST + .get_response() + .unwrap() + .offset() +}); + +#[used] +#[link_section = ".requests"] +static KERNEL_ADDRESS_REQUEST: KernelAddressRequest = KernelAddressRequest::new(); + +/// Converts virtual addresses in the kernel to a physical address like this: +/// ```rs +/// let phys_addr = virt_addr - virtual_base + physical_base; +/// ``` +/// +/// Returns (virtual_base, physical_base) +pub static KERNEL_PHYSICAL_MEMORY_OFFSET: Lazy<(u64, u64)> = Lazy::new(|| { + let resp = KERNEL_ADDRESS_REQUEST.get_response().unwrap(); + + // These are base addresses, using Limine's built in page table. + (resp.virtual_base(), resp.physical_base()) +}); + +/// Fetches the memory map from Limine. +/// +/// # Panics +/// +/// Panics if the memory map was not found in MEMORY_MAP_REQUEST. +pub fn get_memory_map() -> &'static MemoryMapResponse { + if let Some(memory_map) = MEMORY_MAP_REQUEST.get_response() { + return memory_map; + } else { + unreachable!("Could not fetch memory map from Limine.") + } +} diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index c36854e..e667a18 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,7 +1,6 @@ #![no_std] #![feature(abi_x86_interrupt)] -use arch::x86_64::interrupts; use core::arch::asm; use limine::request::{RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; @@ -11,8 +10,6 @@ pub use lib_serial::{serial_print, serial_println, serial_read}; mod arch; -use lib_framebuffer; - /// Sets the base revision to the latest revision supported by the crate. /// See specification for further info. /// Be sure to mark all limine requests with #[used], otherwise they may be removed by the compiler. From 0bbbf653f89b5f39235c7c51e3a43aefcae1277d Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 15:41:41 +0000 Subject: [PATCH 35/41] setup GDT & fixed a deadlock --- Cargo.lock | 7 ++++ kernel/Cargo.toml | 1 + kernel/src/arch/x86_64/gdt.rs | 53 +++++++++++++++++++++++++++- kernel/src/arch/x86_64/interrupts.rs | 37 +++++++++++++++++-- kernel/src/lib.rs | 1 + 5 files changed, 95 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7b8c2c..c575ba9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,6 +38,7 @@ dependencies = [ "lib_framebuffer", "lib_serial", "limine", + "pc-keyboard", "pic8259", "spin", "x86_64", @@ -105,6 +106,12 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "pc-keyboard" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0ca629cbb3f0d5b699c338f0129ff78c9bfd7ea8b1258ad529bff490dc8ed5a" + [[package]] name = "pic8259" version = "0.11.0" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 4759c3f..91a92ca 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -11,6 +11,7 @@ lib_ascii = { path = "../lib/lib_ascii" } x86_64 = "0.15.2" spin = "0.9.8" pic8259 = "0.11.0" +pc-keyboard = "0.8.0" [build-dependencies] cc = "1.2.14" diff --git a/kernel/src/arch/x86_64/gdt.rs b/kernel/src/arch/x86_64/gdt.rs index bf4c036..8d9bad4 100644 --- a/kernel/src/arch/x86_64/gdt.rs +++ b/kernel/src/arch/x86_64/gdt.rs @@ -1,4 +1,12 @@ -use x86_64::{structures::tss::TaskStateSegment, VirtAddr}; +use x86_64::{ + instructions::tables::load_tss, + registers::segmentation::{Segment, CS, DS, ES, SS}, + structures::{ + gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector}, + tss::TaskStateSegment, + }, + VirtAddr, +}; use spin::Lazy; @@ -16,3 +24,46 @@ static TSS: Lazy = Lazy::new(|| { }; tss }); + +static GDT: Lazy<(GlobalDescriptorTable, Selectors)> = Lazy::new(|| { + let mut gdt = GlobalDescriptorTable::new(); + let code_selector = gdt.append(Descriptor::kernel_code_segment()); + let data_selector = gdt.append(Descriptor::kernel_data_segment()); + + let user_code_selector = gdt.append(Descriptor::user_code_segment()); + let user_data_selector = gdt.append(Descriptor::user_data_segment()); + + let tss_selector = gdt.append(Descriptor::tss_segment(&TSS)); + + ( + gdt, + Selectors { + code_selector, + data_selector, + user_code_selector, + user_data_selector, + tss_selector, + }, + ) +}); + +struct Selectors { + code_selector: SegmentSelector, + data_selector: SegmentSelector, + user_code_selector: SegmentSelector, + user_data_selector: SegmentSelector, + tss_selector: SegmentSelector, +} + +pub fn init() { + GDT.0.load(); + + unsafe { + CS::set_reg(GDT.1.code_selector); + load_tss(GDT.1.tss_selector); + + DS::set_reg(self::GDT.1.data_selector); + ES::set_reg(self::GDT.1.data_selector); + SS::set_reg(self::GDT.1.data_selector); + } +} diff --git a/kernel/src/arch/x86_64/interrupts.rs b/kernel/src/arch/x86_64/interrupts.rs index 160cf20..c2c7251 100644 --- a/kernel/src/arch/x86_64/interrupts.rs +++ b/kernel/src/arch/x86_64/interrupts.rs @@ -1,4 +1,4 @@ -use lib_ascii::println_log; +use lib_ascii::{print, println_log}; use lib_serial::serial_println; use x86_64::instructions::port::Port; use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; @@ -6,10 +6,18 @@ use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame}; use pic8259::ChainedPics; use spin::{Lazy, Mutex}; +use super::gdt; + static IDT: Lazy = Lazy::new(|| { let mut idt = InterruptDescriptorTable::new(); idt.breakpoint.set_handler_fn(breakpoint_handler); - idt.double_fault.set_handler_fn(double_fault_handler); + + unsafe { + idt.double_fault + .set_handler_fn(double_fault_handler) + .set_stack_index(gdt::DOUBLE_FAULT_1ST_INDEX); + } + idt.general_protection_fault .set_handler_fn(general_protection_fault_handler); @@ -71,8 +79,31 @@ extern "x86-interrupt" fn double_fault_handler( } extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStackFrame) { + use pc_keyboard::{layouts, DecodedKey, HandleControl, Keyboard, ScancodeSet1}; + use spin::Mutex; + use x86_64::instructions::port::Port; + + static KEYBOARD: Lazy>> = Lazy::new(|| { + Mutex::new(Keyboard::new( + ScancodeSet1::new(), + layouts::Us104Key, + HandleControl::Ignore, + )) + }); + + let mut keyboard = KEYBOARD.lock(); let mut port = Port::new(0x60); - let _scancode: u8 = unsafe { port.read() }; + + let scancode: u8 = unsafe { port.read() }; + if let Ok(Some(key_event)) = keyboard.add_byte(scancode) { + if let Some(key) = keyboard.process_keyevent(key_event) { + match key { + DecodedKey::Unicode(character) => print!("{}", character), + DecodedKey::RawKey(key) => print!("{:?}", key), + } + } + } + unsafe { PICS.lock() .notify_end_of_interrupt(InterruptIndex::Keyboard.as_u8()); diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index c36854e..aa16295 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -53,6 +53,7 @@ pub fn boot() -> Result<(), &'static str> { } lib_serial::init()?; + arch::x86_64::gdt::init(); arch::x86_64::interrupts::init_idt(); x86_64::instructions::interrupts::enable(); From 7b3ba170f0053689e569c119b0a87dbdcbb2c3e2 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 15:43:06 +0000 Subject: [PATCH 36/41] changes to submodules --- lib/lib_ascii | 2 +- lib/lib_serial | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/lib_ascii b/lib/lib_ascii index 1ae956e..70d528b 160000 --- a/lib/lib_ascii +++ b/lib/lib_ascii @@ -1 +1 @@ -Subproject commit 1ae956efa44d7ebb009ce23ee917a76cb4df96ca +Subproject commit 70d528b2e8dc4d5b522955c248f47da74ce28678 diff --git a/lib/lib_serial b/lib/lib_serial index 813fc0b..ed2fa6b 160000 --- a/lib/lib_serial +++ b/lib/lib_serial @@ -1 +1 @@ -Subproject commit 813fc0bfa3a14069c5a7ee18c1d70a025d12f48d +Subproject commit ed2fa6b50102607d33973c1851a0ec8c895ed4fa From 36cb11893312d6f9473fbb0e60a51005b7769a4d Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 16:56:01 +0000 Subject: [PATCH 37/41] paging done, starting on allocation. --- .cargo/config.toml | 2 +- .gitmodules | 3 + Cargo.lock | 5 ++ Cargo.toml | 3 +- kernel/Cargo.toml | 1 + kernel/src/arch/x86_64/memory.rs | 137 +++++++++++++++++++++++++++++++ kernel/src/arch/x86_64/mod.rs | 4 + kernel/src/lib.rs | 18 +++- lib/lib_alloc | 1 + 9 files changed, 170 insertions(+), 4 deletions(-) create mode 100644 kernel/src/arch/x86_64/memory.rs create mode 160000 lib/lib_alloc diff --git a/.cargo/config.toml b/.cargo/config.toml index 3b01eb5..cd125e0 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,7 +3,7 @@ target = "x86_64-kernel" target-dir = "build/target" [unstable] -build-std = ["core", "compiler_builtins"] +build-std = ["core", "compiler_builtins", "alloc"] build-std-features = ["compiler-builtins-mem"] [env] diff --git a/.gitmodules b/.gitmodules index de08738..d74f31e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,3 +10,6 @@ [submodule "lib/lib_serial"] path = lib/lib_serial url = https://git.zxq5.dev/OsDev/FoundryOS-lib_serial.git +[submodule "lib/lib_alloc"] + path = lib/lib_alloc + url = https://git.zxq5.dev/OsDev/FoundryOS-lib_alloc.git diff --git a/Cargo.lock b/Cargo.lock index c575ba9..97d2c0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,6 +34,7 @@ name = "foundry_os" version = "0.1.0" dependencies = [ "cc", + "lib_alloc", "lib_ascii", "lib_framebuffer", "lib_serial", @@ -53,6 +54,10 @@ dependencies = [ "spin", ] +[[package]] +name = "lib_alloc" +version = "0.1.0" + [[package]] name = "lib_application" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 972ad1a..d9f1b96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,8 @@ members = [ "lib/lib_serial", "lib/lib_ascii", "kernel", - "lib/lib_application", + "lib/lib_application", + "lib/lib_alloc", ] resolver = "2" diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 91a92ca..9958b56 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -8,6 +8,7 @@ limine = "0.3.1" lib_framebuffer = { path = "../lib/lib_framebuffer" } lib_serial = { path = "../lib/lib_serial" } lib_ascii = { path = "../lib/lib_ascii" } +lib_alloc = { path = "../lib/lib_alloc" } x86_64 = "0.15.2" spin = "0.9.8" pic8259 = "0.11.0" diff --git a/kernel/src/arch/x86_64/memory.rs b/kernel/src/arch/x86_64/memory.rs new file mode 100644 index 0000000..5eaf729 --- /dev/null +++ b/kernel/src/arch/x86_64/memory.rs @@ -0,0 +1,137 @@ +use lib_alloc::allocator::FoundryAllocator; +use limine::{memory_map::EntryType, response::MemoryMapResponse}; +use x86_64::{ + addr, + registers::control::Cr3, + structures::paging::{ + page_table::FrameError, FrameAllocator, OffsetPageTable, PageTable, PhysFrame, Size4KiB, + }, + PhysAddr, VirtAddr, +}; + +#[global_allocator] +static ALLOCATOR: FoundryAllocator = FoundryAllocator; + +/// Returns a mutable reference to the current level 4 page table. +/// +/// # Safety +/// +/// The caller must ensure that the level 4 page table is not modified +/// simultaneously. The caller must also ensure that the physical memory offset +/// is correct, to ensure that the correct virtual address is constructed. +unsafe fn active_l4_table(physical_memory_offset: VirtAddr) -> &'static mut PageTable { + let (level_4_frame, _) = Cr3::read(); + + let phys_addr = level_4_frame.start_address(); + let virt = phys_addr.as_u64() + physical_memory_offset.as_u64(); + &mut *(virt as *mut PageTable) +} + +/// Initializes the `OffsetPageTable` for the current CPU architecture. +/// +/// # Safety +/// +/// This function must be called only once and should be called before any +/// memory operations are performed that rely on virtual memory management. +/// The provided `physical_memory_offset` must be accurate to ensure correct +/// translation of physical addresses. +/// +/// # Parameters +/// +/// - `physical_memory_offset`: The offset to convert physical addresses to +/// virtual addresses in the higher-half direct map. +/// +/// # Returns +/// +/// Returns an `OffsetPageTable` that allows for manipulation of the page +/// tables for the current CPU architecture. +pub unsafe fn init(physical_memory_offset: VirtAddr) -> OffsetPageTable<'static> { + let l4_table = active_l4_table(physical_memory_offset); + OffsetPageTable::new(l4_table, physical_memory_offset) +} + +pub(crate) struct FoundryOSFrameAllocator { + memory_map: &'static MemoryMapResponse, + next: usize, +} + +impl FoundryOSFrameAllocator { + /// Creates a new `FoundryOSFrameAllocator` from a memory map. + /// + /// This function takes a reference to a `MemoryMapResponse` and initializes a + /// `FoundryOSFrameAllocator` with it. The `next` field is set to 0, indicating that + /// the first frame to be allocated is the first frame in the memory map. + pub unsafe fn init(memory_map: &'static MemoryMapResponse) -> FoundryOSFrameAllocator { + FoundryOSFrameAllocator { + memory_map, + next: 0, + } + } + + /// An iterator over all usable frames in the memory map. + /// + /// Yields one `PhysFrame` for each available 4KiB frame in the memory map. + /// + /// This function is used to allocate frames for the pagemap. + fn usable_frames(&self) -> impl Iterator { + let regions = self.memory_map.entries().iter(); + let usable_regions = regions.filter(|region| region.entry_type == EntryType::USABLE); + + let addr_ranges = usable_regions.map(|region| region.base..region.base + region.length); + + let frame_addresses = addr_ranges.flat_map(|r| r.step_by(4096)); + + frame_addresses.map(|addr| PhysFrame::from_start_address(PhysAddr::new(addr)).unwrap()) + } +} + +unsafe impl FrameAllocator for FoundryOSFrameAllocator { + /// Allocates a frame from the list of usable frames. + /// + /// This function returns the next available `PhysFrame` from the memory map, + /// if one exists. Once a frame is allocated, the internal counter is incremented + /// to point to the next frame for future allocations. + /// + /// # Returns + /// + /// - `Some(PhysFrame)`: If a usable frame is available. + /// - `None`: If there are no more usable frames to allocate. + + fn allocate_frame(&mut self) -> Option { + let frame = self.usable_frames().nth(self.next); + self.next += 1; + frame + } +} + +// pub unsafe fn translate_addr(addr: VirtAddr, physical_memory_offset: VirtAddr) -> Option { +// translate_addr_inner(addr, physical_memory_offset) +// } + +// fn translate_addr_inner(addr: VirtAddr, physical_memory_offset: VirtAddr) -> Option { +// let (l4_table_frame, _) = Cr3::read(); + +// let table_indexes = [ +// addr.p4_index(), +// addr.p3_index(), +// addr.p2_index(), +// addr.p1_index(), +// ]; +// let mut frame = l4_table_frame; + +// for &i in &table_indexes { +// let virt = physical_memory_offset + frame.start_address().as_u64(); +// let table_ptr: *const PageTable = virt.as_ptr(); +// let table = unsafe { &*table_ptr }; + +// let entry = &table[i]; + +// frame = match entry.frame() { +// Ok(frame) => frame, +// Err(FrameError::FrameNotPresent) => return None, +// Err(FrameError::HugeFrame) => panic!("huge frames are not supported!"), +// }; +// } + +// Some(frame.start_address() + u64::from(addr.page_offset())) +// } diff --git a/kernel/src/arch/x86_64/mod.rs b/kernel/src/arch/x86_64/mod.rs index cd849ac..c8adf09 100644 --- a/kernel/src/arch/x86_64/mod.rs +++ b/kernel/src/arch/x86_64/mod.rs @@ -1,3 +1,7 @@ pub mod gdt; pub mod interrupts; + +pub mod memory; + +pub(crate) mod memmap; diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index fa3c6dd..dc8d5d9 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -1,12 +1,16 @@ #![no_std] #![feature(abi_x86_interrupt)] +extern crate alloc; + use core::arch::asm; use limine::request::{RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; pub use lib_ascii::{print, print_log, println, println_log, WRITER}; pub use lib_serial::{serial_print, serial_println, serial_read}; +use x86_64::structures::paging::Translate; +use x86_64::{PhysAddr, VirtAddr}; mod arch; @@ -28,6 +32,8 @@ static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new(); #[panic_handler] fn rust_panic(_info: &core::panic::PanicInfo) -> ! { + println!("Kernel panic: {}", _info); + serial_println!("Kernel panic: {}", _info); hcf(); } @@ -49,11 +55,19 @@ pub fn boot() -> Result<(), &'static str> { return Err("base revision not supported"); } + use arch::x86_64::{gdt, interrupts, memmap, memory}; + + let memory_map = memmap::get_memory_map(); lib_serial::init()?; - arch::x86_64::gdt::init(); - arch::x86_64::interrupts::init_idt(); + gdt::init(); + interrupts::init_idt(); + + let mut frame_allocator = unsafe { memory::FoundryOSFrameAllocator::init(memory_map) }; x86_64::instructions::interrupts::enable(); + let physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET); + let l4_table = unsafe { memory::init(physical_memory_offset) }; + Ok(()) } diff --git a/lib/lib_alloc b/lib/lib_alloc new file mode 160000 index 0000000..3aeb5d6 --- /dev/null +++ b/lib/lib_alloc @@ -0,0 +1 @@ +Subproject commit 3aeb5d66c8e7f3adb4e7ff01d89c01b45a89c159 From 361c67764d3a08512e3491020ef3647a0e7db7b9 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 21:02:29 +0000 Subject: [PATCH 38/41] totally didn't import an allocator... --- Cargo.lock | 22 ++++++++++++++++++++++ kernel/src/arch/x86_64/memory.rs | 3 --- kernel/src/lib.rs | 5 ++++- kernel/src/main.rs | 10 ++++++++++ 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97d2c0b..fdff085 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,6 +57,10 @@ dependencies = [ [[package]] name = "lib_alloc" version = "0.1.0" +dependencies = [ + "linked_list_allocator", + "x86_64", +] [[package]] name = "lib_application" @@ -101,6 +105,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "linked_list_allocator" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" +dependencies = [ + "spinning_top", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -153,6 +166,15 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spinning_top" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0" +dependencies = [ + "lock_api", +] + [[package]] name = "volatile" version = "0.4.6" diff --git a/kernel/src/arch/x86_64/memory.rs b/kernel/src/arch/x86_64/memory.rs index 5eaf729..b7dcb90 100644 --- a/kernel/src/arch/x86_64/memory.rs +++ b/kernel/src/arch/x86_64/memory.rs @@ -9,9 +9,6 @@ use x86_64::{ PhysAddr, VirtAddr, }; -#[global_allocator] -static ALLOCATOR: FoundryAllocator = FoundryAllocator; - /// Returns a mutable reference to the current level 4 page table. /// /// # Safety diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index dc8d5d9..7df15db 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -4,6 +4,7 @@ extern crate alloc; use core::arch::asm; +use lib_alloc::allocator::init_heap; use limine::request::{RequestsEndMarker, RequestsStartMarker}; use limine::BaseRevision; @@ -67,7 +68,9 @@ pub fn boot() -> Result<(), &'static str> { x86_64::instructions::interrupts::enable(); let physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET); - let l4_table = unsafe { memory::init(physical_memory_offset) }; + let mut l4_table = unsafe { memory::init(physical_memory_offset) }; + + init_heap(&mut l4_table, &mut frame_allocator); Ok(()) } diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 5c5ddbf..77f4ac4 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -1,6 +1,10 @@ #![no_std] #![no_main] +extern crate alloc; + +use alloc::vec::Vec; + use foundry_os::{println, println_log}; #[no_mangle] @@ -40,5 +44,11 @@ unsafe extern "C" fn kmain() -> ! { " ); + let mut vec = Vec::new(); + for i in 0..100 { + vec.push(i); + } + println!("{:?}", vec); + loop {} } From 114c70ffe96f16ab7125a5c5a4880a03077c1f51 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 21:03:17 +0000 Subject: [PATCH 39/41] updated submodules --- lib/lib_alloc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/lib_alloc b/lib/lib_alloc index 3aeb5d6..af814bf 160000 --- a/lib/lib_alloc +++ b/lib/lib_alloc @@ -1 +1 @@ -Subproject commit 3aeb5d66c8e7f3adb4e7ff01d89c01b45a89c159 +Subproject commit af814bf2ab9db4077f96ad63e3d34afcc56da942 From 494d00c53b86a04d3f515cbee39f5f1c87d77a22 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 21:18:14 +0000 Subject: [PATCH 40/41] Update .gitea/workflows/rust.yml --- .gitea/workflows/rust.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/rust.yml b/.gitea/workflows/rust.yml index 4c85fad..f1b3660 100644 --- a/.gitea/workflows/rust.yml +++ b/.gitea/workflows/rust.yml @@ -1,4 +1,8 @@ -on: [push, pull_request] +on: + push: + branches: [ main ] + pull-request: + branches: [ main ] name: Continuous integration From f9bc75c4f3046162835ef643ab0949c27ffd1395 Mon Sep 17 00:00:00 2001 From: zxq5 Date: Sat, 22 Feb 2025 21:30:13 +0000 Subject: [PATCH 41/41] added boot messages --- kernel/src/lib.rs | 25 ++++++++++++++++++++++--- kernel/src/main.rs | 10 +++------- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index 7df15db..43e0ab4 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -59,18 +59,37 @@ pub fn boot() -> Result<(), &'static str> { use arch::x86_64::{gdt, interrupts, memmap, memory}; let memory_map = memmap::get_memory_map(); + + print_log!(" Initialising Serial... "); lib_serial::init()?; + println_log!("[Success]"); + + print_log!(" Setting Up Global Descriptor Table... "); gdt::init(); + println_log!("[Success]"); + + print_log!(" Setting Up Interrupt Descriptor Table... "); interrupts::init_idt(); + println_log!("[Success]"); + print_log!(" Setting Up Page Table... "); let mut frame_allocator = unsafe { memory::FoundryOSFrameAllocator::init(memory_map) }; + println_log!("[Success]"); - x86_64::instructions::interrupts::enable(); - + print_log!(" Initialising Memory Subsystem... "); let physical_memory_offset = VirtAddr::new(*memmap::PHYSICAL_MEMORY_OFFSET); let mut l4_table = unsafe { memory::init(physical_memory_offset) }; + println_log!("[Success]"); - init_heap(&mut l4_table, &mut frame_allocator); + print_log!(" Initialising Heap... "); + if let Err(e) = init_heap(&mut l4_table, &mut frame_allocator) { + return Err("Failed to initialise heap"); + } + println_log!("[Success]"); + + print_log!(" Enabling Interrupts... "); + x86_64::instructions::interrupts::enable(); + println_log!("[Success]"); Ok(()) } diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 77f4ac4..20b95e3 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -12,11 +12,13 @@ unsafe extern "C" fn kmain() -> ! { // All limine requests must also be referenced in a called function, otherwise they may be // removed by the linker. - println_log!(" [ Initialising ] "); + println_log!(" [ Initialising Kernel Systems ] "); if let Err(err) = foundry_os::boot() { panic!("{}", err); } + println_log!("[ Kernel Initialised Successfully ] "); + let dimensions = lib_ascii::screensize_chars(); let dimensions2 = lib_framebuffer::screensize_px(); @@ -44,11 +46,5 @@ unsafe extern "C" fn kmain() -> ! { " ); - let mut vec = Vec::new(); - for i in 0..100 { - vec.push(i); - } - println!("{:?}", vec); - loop {} }