Compare commits

..

361 Commits

Author SHA1 Message Date
Philipp Oppermann
bb5899e437 Merge branch 'post-03' into post-04 2025-09-03 17:58:33 +02:00
Philipp Oppermann
93d0daa1e0 Merge branch 'post-02' into post-03 2025-09-03 17:58:28 +02:00
Philipp Oppermann
83e6c0bc00 Merge pull request #1436 from phil-opp/post-02-fix-target
Fix: `target-pointer-width` field now expects an integer
2025-09-03 17:56:38 +02:00
Philipp Oppermann
2b11ad8397 Fix: target-pointer-width field now expects an integer 2025-09-03 17:53:14 +02:00
Philipp Oppermann
fa51f3adbf Update to latest bootloader version 2025-09-03 17:52:56 +02:00
Philipp Oppermann
ceb91f955a Merge pull request #1434 from phil-opp/post-04-test-true
Set `test=true` to enable `main.rs` testing again
2025-08-26 16:41:21 +02:00
Philipp Oppermann
3340babf51 Set test=true to enable main.rs testing again
We set `test=false` for previous posts in https://github.com/phil-opp/blog_os/pull/1412 to avoid errors e.g. in rust-analyzer. For this testing post, we want to set it back to `true`.
2025-08-26 16:21:28 +02:00
Philipp Oppermann
37a0ae0097 Run cargo update 2025-08-18 09:44:27 +02:00
Philipp Oppermann
6fc9fbfb7d Merge branch 'post-03' into post-04 2025-08-18 09:44:16 +02:00
Philipp Oppermann
1f097bba71 Run cargo update 2025-08-18 09:43:39 +02:00
Philipp Oppermann
99fbbad9b0 Merge branch 'post-02' into post-03 2025-08-18 09:43:25 +02:00
Philipp Oppermann
94d14d8d62 Run cargo update for bootloader crate 2025-08-18 09:42:41 +02:00
Philipp Oppermann
ebfc7c5f7e Merge branch 'post-03' into post-04 2025-08-07 13:09:45 +02:00
Philipp Oppermann
6f0be666f3 Merge branch 'post-02' into post-03 2025-08-07 13:09:45 +02:00
Philipp Oppermann
d9fa84edd6 Merge pull request #1425 from phil-opp/post-02-fix-target
Fix: `target-c-int-width` field now expects an integer
2025-08-07 13:09:35 +02:00
Philipp Oppermann
d1bf96108a Merge branch 'post-03' into post-04 2025-08-07 13:08:00 +02:00
Philipp Oppermann
97de98df33 Merge branch 'post-02' into post-03 2025-08-07 13:07:41 +02:00
Philipp Oppermann
9684f75819 Merge branch 'post-01' into post-02 2025-08-07 13:07:09 +02:00
Philipp Oppermann
d6cc562907 Fix: target-c-int-width field now expects an integer 2025-08-07 12:25:03 +02:00
Philipp Oppermann
1d0aa17531 Update tests to make no_mangle attribute unsafe
Required since Rust 2024 edition
2025-03-27 15:50:07 +01:00
Philipp Oppermann
e4b3ed6d42 Fix: no_mangle is an unsafe attribute since Rust 2024 2025-03-27 15:13:34 +01:00
Philipp Oppermann
b1aec7eb66 Merge branch 'post-03' into post-04 2025-03-27 15:13:25 +01:00
Philipp Oppermann
e2a3e76a32 Merge branch 'post-02' into post-03 2025-03-27 15:07:41 +01:00
Philipp Oppermann
16bbb8f972 Merge branch 'post-01' into post-02 2025-03-27 15:07:24 +01:00
Philipp Oppermann
a6141e8d2e Merge branch 'post-03' into post-04 2025-03-24 11:09:24 +01:00
Philipp Oppermann
df0c0b5783 Merge branch 'post-02' into post-03 2025-03-24 11:09:21 +01:00
Philipp Oppermann
c27eb1da9c Run cargo update for bootloader crate 2025-03-24 11:08:41 +01:00
Philipp Oppermann
deb7c82872 Merge branch 'post-03' into post-04 2025-02-10 12:36:07 +01:00
Philipp Oppermann
2a61f88d8a Merge branch 'post-02' into post-03 2025-02-10 12:35:54 +01:00
Philipp Oppermann
a90a8bea67 Run cargo update for bootloader crate 2025-02-10 12:35:16 +01:00
Philipp Oppermann
fda382c6bc Merge branch 'post-03' into post-04 2025-02-10 11:16:21 +01:00
Philipp Oppermann
f52872f3b9 Merge branch 'post-02' into post-03 2025-02-10 11:16:21 +01:00
Philipp Oppermann
688a21e4ed Set rustc-abi: x86-softfloat in target JSON
This additional field is required by the Rust compiler since https://github.com/rust-lang/rust/pull/136146 .
2025-02-10 11:16:14 +01:00
Philipp Oppermann
75354fe142 Merge branch 'post-03' into post-04 2024-04-30 15:39:16 +02:00
Philipp Oppermann
07d6c9c84e Merge branch 'post-02' into post-03 2024-04-30 15:39:07 +02:00
Philipp Oppermann
2265ddecad Run cargo update 2024-04-30 15:37:30 +02:00
Philipp Oppermann
9edc2c59c7 Merge branch 'post-03' into post-04 2024-02-16 15:59:40 +01:00
Philipp Oppermann
3bc023ec2d Merge branch 'post-02' into post-03 2024-02-16 15:59:38 +01:00
Philipp Oppermann
38604da92f Update bootloader version to v0.9.27 in Cargo.lock 2024-02-16 15:59:13 +01:00
Philipp Oppermann
6e7c2f4344 Merge branch 'post-03' into post-04 2024-02-16 13:22:06 +01:00
Philipp Oppermann
1a53a115da Merge branch 'post-02' into post-03 2024-02-16 13:21:45 +01:00
Philipp Oppermann
c6990cb52d Don't specify patch version in Cargo.toml
Avoids confusion for people that don't know that cargo always chooses the latest patch version.
2024-02-16 13:21:21 +01:00
Philipp Oppermann
3916bebd15 Merge branch 'post-03' into post-04 2024-02-16 13:14:09 +01:00
Philipp Oppermann
ef9bb1a087 Merge branch 'post-02' into post-03 2024-02-16 13:13:55 +01:00
Philipp Oppermann
2bc4490404 Update bootloader version to v0.9.26 in Cargo.lock 2024-02-16 13:13:31 +01:00
Philipp Oppermann
f45954e7e4 Merge branch 'post-03' into post-04 2024-02-16 12:39:56 +01:00
Philipp Oppermann
7288459bdf Merge branch 'post-02' into post-03 2024-02-16 12:39:51 +01:00
Philipp Oppermann
7959b77ebd Update data layout for LLVM 18
Fixes build on latest rustc nightly.
2024-02-16 12:38:32 +01:00
Philipp Oppermann
bebad6d5a9 Update bootloader version in Cargo.lock 2024-02-16 12:36:31 +01:00
Philipp Oppermann
c73b412ec6 Merge branch 'post-03' into post-04 2024-01-28 11:45:38 +01:00
Philipp Oppermann
6c8fea8b00 Merge branch 'post-02' into post-03 2024-01-28 11:45:32 +01:00
Philipp Oppermann
b99c3f6d1d Use latest data layout for custom target 2024-01-28 11:44:35 +01:00
Philipp Oppermann
66c1792034 Update bootloader version in Cargo.lock 2024-01-28 11:44:23 +01:00
Philipp Oppermann
445833408c Merge branch 'post-03' into post-04 2022-09-25 11:32:07 +02:00
Philipp Oppermann
3280a0afc7 Merge branch 'post-02' into post-03 2022-09-25 11:31:07 +02:00
Philipp Oppermann
6393247a3b Update bootloader version in Cargo.lock 2022-09-25 11:29:38 +02:00
Philipp Oppermann
8622b9c41b Merge branch 'post-03' into post-04 2022-01-18 10:06:44 +01:00
Philipp Oppermann
a387a00c85 Merge branch 'post-02' into post-03
# Conflicts:
#	Cargo.lock
2022-01-18 10:06:27 +01:00
Philipp Oppermann
faa8d15cb7 Run cargo update for bootloader crate 2022-01-18 10:05:56 +01:00
Philipp Oppermann
736a4183db Merge branch 'post-03' into post-04 2021-12-22 09:27:53 +01:00
Philipp Oppermann
4c9cd3ae32 Merge branch 'post-02' into post-03 2021-12-22 09:27:26 +01:00
Philipp Oppermann
26f1f5b896 Run cargo update for bootloader crate 2021-12-22 09:27:00 +01:00
Philipp Oppermann
c2dd2477ab Run cargo update for bootloader and x86_64 crates 2021-12-21 12:43:22 +01:00
Philipp Oppermann
9d16f0a139 CI: Use choco to install QEMU 6.0.0
This should fix our CI build errors. We install a pinned version of QEMU since the latest 6.1 pre-releases appear to have some problems too.
2021-08-22 14:36:17 +02:00
Philipp Oppermann
a671ad3dbc Merge branch 'post-03' into post-04 2021-05-21 19:54:47 +02:00
Philipp Oppermann
cbead25b43 Merge branch 'post-02' into post-03 2021-05-21 19:54:20 +02:00
Philipp Oppermann
1f49e2e9fe Merge branch 'post-01' into post-02 2021-05-21 19:53:49 +02:00
Philipp Oppermann
765c7b21e9 Merge branch 'post-03' into post-04 2021-05-20 14:33:10 +02:00
Philipp Oppermann
2c25d55810 Merge branch 'post-02' into post-03 2021-05-20 14:32:42 +02:00
Philipp Oppermann
021762cf30 Run cargo update for bootloader 2021-05-20 14:32:27 +02:00
Philipp Oppermann
eb2f818194 Merge branch 'post-04-update-x86_64' into post-04 2021-05-17 11:41:19 +02:00
Philipp Oppermann
167ef5bb83 Update x86_64 dependency to v0.14.2 to fix nightly breakage 2021-05-17 11:38:51 +02:00
Philipp Oppermann
4f68f9ba93 Run cargo update for uart_16550 crate 2021-05-17 11:30:00 +02:00
Philipp Oppermann
36e4dc22f3 Merge branch 'post-03' into post-04 2021-05-17 11:29:23 +02:00
Philipp Oppermann
ec95ac0e5a Merge branch 'post-02' into post-03 2021-05-17 11:29:14 +02:00
Philipp Oppermann
d8f280315f Run cargo update for bootloader crate 2021-05-17 11:28:54 +02:00
Philipp Oppermann
0e365109be Merge branch 'post-03' into post-04 2021-03-10 09:23:02 +01:00
Philipp Oppermann
e39c7d8ad8 Merge branch 'post-02' into post-03 2021-03-10 09:23:02 +01:00
Philipp Oppermann
066c278277 Merge branch 'post-01' into post-02 2021-03-10 09:23:02 +01:00
Philipp Oppermann
c8f72adeb3 Merge branch 'post-03' into post-04 2021-03-10 09:15:58 +01:00
Philipp Oppermann
f40717901b Merge branch 'post-02' into post-03 2021-03-10 09:15:58 +01:00
Philipp Oppermann
96844f6519 Merge branch 'post-01' into post-02 2021-03-10 09:15:58 +01:00
Philipp Oppermann
cc617ec35e Merge branch 'post-03' into post-04 2021-03-10 09:13:39 +01:00
Philipp Oppermann
195f4489e6 Merge branch 'post-02' into post-03 2021-03-10 09:13:39 +01:00
Philipp Oppermann
1b86d7fd62 Merge branch 'post-01' into post-02 2021-03-10 09:13:39 +01:00
Philipp Oppermann
bee9a7f7ea Merge branch 'post-03' into post-04 2021-03-10 08:53:42 +01:00
Philipp Oppermann
fbdcd45d16 Merge branch 'post-02' into post-03 2021-03-10 08:53:37 +01:00
Philipp Oppermann
d658949f5b Run cargo update for bootloader crate 2021-03-10 08:53:21 +01:00
Philipp Oppermann
4c07101f8f Merge pull request #919 from phil-opp/post-04-update-x86_64
Update x86_64 dependency to v0.13.2 to fix nightly breakage
2021-02-02 11:06:15 +01:00
Philipp Oppermann
30be97d035 Update x86_64 dependency to v0.13.2 to fix nightly breakage
Also: Run cargo update for uart_16550 dependency.
2021-02-02 10:54:08 +01:00
Philipp Oppermann
63d0d8cc9f Merge branch 'post-03' into post-04 2021-02-02 10:52:06 +01:00
Philipp Oppermann
d12842bcd5 Merge branch 'post-02' into post-03 2021-02-02 10:52:00 +01:00
Philipp Oppermann
0e52ccbebb Run cargo update for bootloader crate 2021-02-02 10:51:03 +01:00
Philipp Oppermann
4de18a8a10 CI: Use environment files instead of deprecated set-env 2020-11-22 13:27:41 +01:00
Philipp Oppermann
3fac6af7b0 Merge branch 'post-03' into post-04 2020-10-02 23:35:18 +02:00
Philipp Oppermann
d4e1f47e62 Update post-04 to use compiler_builtins mem feature instead of rlibc (#868)
* Remove rlibc and use compiler-builtins-mem feature (#865)

* Update post-04 to use compiler_builtins `mem` feature instead of `rlibc`

Co-authored-by: Rob Gries <robert.w.gries@gmail.com>
2020-10-02 23:28:03 +02:00
Philipp Oppermann
ea5aad0e0c Merge branch 'post-02' into post-03 2020-10-02 23:17:08 +02:00
Rob Gries
4e38e7ddf8 Remove rlibc and use compiler-builtins-mem feature (#865) 2020-10-02 23:14:25 +02:00
Philipp Oppermann
4215162b62 cargo update the x86_64 and uart_16550 crates to fix nightly breakage 2020-09-29 12:21:59 +02:00
Philipp Oppermann
1afa3af79d Merge branch 'post-02' into post-03 2020-09-29 12:19:54 +02:00
Philipp Oppermann
35c642b3c2 Merge branch 'post-03' into post-04 2020-09-29 12:19:54 +02:00
Philipp Oppermann
49dce7ada7 cargo update the bootloadercrate to fix nightly breakage 2020-09-29 12:19:48 +02:00
Philipp Oppermann
3d96415940 Update x86_64 to v0.12.1 (#858) 2020-09-24 10:26:04 +02:00
Philipp Oppermann
fd8a2e0182 Merge branch 'post-03' into post-04 2020-09-24 10:10:51 +02:00
Philipp Oppermann
552eb97f75 Merge branch 'post-02' into post-03 2020-09-24 10:10:16 +02:00
Philipp Oppermann
c42cee8d89 Update bootloader to 0.9.10 2020-09-24 10:09:57 +02:00
Philipp Oppermann
3bb076a00f Run cargo update for post-04 2020-09-24 09:09:13 +02:00
Philipp Oppermann
e5bd06edcc Merge branch 'post-03' into post-04 2020-09-24 09:08:54 +02:00
Philipp Oppermann
eace075f2c Run cargo update for post-03 2020-09-24 09:08:28 +02:00
Philipp Oppermann
2d5150f2a3 Merge branch 'post-02' into post-03 2020-09-24 09:08:11 +02:00
Philipp Oppermann
ebb9f0b8a7 Run cargo update 2020-09-24 09:07:45 +02:00
Philipp Oppermann
edd155d570 Merge branch 'post-03' into post-04 2020-08-16 18:03:09 +02:00
Philipp Oppermann
3200b7a68d Merge branch 'post-02' into post-03 2020-08-16 18:03:09 +02:00
Philipp Oppermann
cde3c8f955 Merge branch 'post-01' into post-02 2020-08-16 18:03:09 +02:00
Philipp Oppermann
c18cd874ca Merge branch 'post-03' into post-04 2020-07-17 15:57:35 +02:00
Philipp Oppermann
f316bd1a08 Merge branch 'post-02' into post-03 2020-07-17 15:57:35 +02:00
Philipp Oppermann
4a4d704384 Add note about minimum required nightly version 2020-07-17 15:57:32 +02:00
Philipp Oppermann
6380e069f7 Merge branch 'post-03' into post-04 2020-07-17 11:48:35 +02:00
Philipp Oppermann
1ddc27ca88 Merge branch 'post-02' into post-03 2020-07-17 11:48:35 +02:00
Philipp Oppermann
71d8a438f7 Update Readme for new build-std build instructions 2020-07-17 11:48:27 +02:00
Philipp Oppermann
3a77cbe794 Merge branch 'post-01' into post-02 2020-07-17 11:44:17 +02:00
Philipp Oppermann
7341cff39d Merge branch 'post-03' into post-04 2020-07-17 11:28:04 +02:00
Philipp Oppermann
406c406d5f Merge branch 'post-02' into post-03 2020-07-17 11:28:04 +02:00
Philipp Oppermann
6f9cfce6f9 Don't deny clippy warnings 2020-07-17 11:27:18 +02:00
Philipp Oppermann
acf3717551 Move extern crate rlibc to lib.rs 2020-07-17 11:22:42 +02:00
Philipp Oppermann
e78d33a5bf Update test command on CI for build-std 2020-07-17 11:21:18 +02:00
Philipp Oppermann
6292789393 Merge branch 'post-03' into post-04 2020-07-17 11:19:25 +02:00
Philipp Oppermann
651adbc8bd Merge branch 'post-02' into post-03 2020-07-17 11:16:18 +02:00
Philipp Oppermann
4bbaae24a4 Merge pull request #835 from phil-opp/post-02-Zbuild-std
Migrate post-02 code from cargo-xbuild to `-Zbuild-std`
2020-07-17 11:13:11 +02:00
Philipp Oppermann
44d7654ef6 Add toml extension to .cargo/config and use table format for unstable 2020-07-17 10:57:04 +02:00
Philipp Oppermann
f135aefae8 Update to bootloader 0.9.8 2020-07-17 10:52:21 +02:00
Philipp Oppermann
ffaac76876 Use latest release of bootimage on CI 2020-07-17 10:52:08 +02:00
Philipp Oppermann
5ae9f62f4d Adjust job names on CI to match existing names 2020-07-16 17:15:03 +02:00
Philipp Oppermann
da0ee38f09 Add names for all CI operations 2020-07-16 17:10:50 +02:00
Philipp Oppermann
263e852dcc Use functionality of toolchain action for installing rustup components 2020-07-16 17:04:02 +02:00
Philipp Oppermann
614e5b0e86 Install rustup components after checking out the repo
so that the components are installed for the nightly toolchain.
2020-07-16 16:36:19 +02:00
Philipp Oppermann
9ee42e0f5f Install Zbuild-std branch of bootimage 2020-07-16 16:32:50 +02:00
Philipp Oppermann
c4672096d4 Install rust-src component for cargo check 2020-07-16 16:31:52 +02:00
Philipp Oppermann
ffe1b6abd0 Rewrite CI script with using actions-rs actions
This gives use support for github's scoped annotations when there are errors or warnings.
2020-07-16 16:21:37 +02:00
Philipp Oppermann
16ffe80fd5 Add dependency on rlibc 2020-07-16 15:39:07 +02:00
Philipp Oppermann
07d8a22a53 Use -Zbuildstd instead of cargo-xbuild 2020-07-16 15:37:09 +02:00
Philipp Oppermann
bf33685d00 Merge pull request #816 from phil-opp/post-04-testable-trait
Create a testable trait for printing test messages automatically
2020-06-08 11:50:57 +02:00
Philipp Oppermann
3ee6badb33 Keep trivial_assertion test 2020-06-08 11:39:09 +02:00
Philipp Oppermann
9f9ff59489 Create a testable trait for printing test messages automatically 2020-06-08 11:04:03 +02:00
Philipp Oppermann
a1c7931a77 Run cargo update for post-04 2020-05-20 14:56:06 +02:00
Philipp Oppermann
2c30310281 Update x86_64 to version 0.11.0 2020-05-20 14:25:16 +02:00
Philipp Oppermann
57cd52b7f5 Merge branch 'post-03' into post-04 2020-05-20 14:04:54 +02:00
Philipp Oppermann
a004e7da9c Merge branch 'post-02' into post-03 2020-05-20 14:04:37 +02:00
Philipp Oppermann
b1bf0873ce Update bootloader to v0.9.3 2020-05-20 14:03:59 +02:00
Philipp Oppermann
d7e505da9e Update x86_64 dependency to version 0.9.6 2020-03-08 14:39:27 +01:00
Philipp Oppermann
2039cd7a64 Update x86_64 to version 0.9.5 2020-03-08 14:27:36 +01:00
Philipp Oppermann
ebb862de2a Run cargo update for post-04 2020-02-26 12:46:04 +01:00
Philipp Oppermann
d588dca953 Merge branch 'post-03' into post-04 2020-02-26 12:45:45 +01:00
Philipp Oppermann
f23269ed93 Merge branch 'post-02' into post-03 2020-02-26 12:45:27 +01:00
Philipp Oppermann
46264d08ca Run cargo update 2020-02-26 12:43:51 +01:00
Philipp Oppermann
029d6bee78 Update Github Actions badge for post-04 2019-12-12 09:29:31 +01:00
Philipp Oppermann
0fc6fedd82 Merge branch 'post-03' into post-04 2019-12-12 09:29:14 +01:00
Philipp Oppermann
0489c09d05 Update Github Actions badge for post-03 2019-12-12 09:28:56 +01:00
Philipp Oppermann
99b139ddff Merge branch 'post-02' into post-03 2019-12-12 09:28:44 +01:00
Philipp Oppermann
fea4fa9c67 Update Github Actions badge for post-02 2019-12-12 09:28:05 +01:00
Philipp Oppermann
ddbe317099 Merge branch 'post-01' into post-02 2019-12-12 09:27:30 +01:00
Philipp Oppermann
56cf71df9f Merge branch 'post-03' into post-04 2019-12-12 09:23:30 +01:00
Philipp Oppermann
abd2f4c5e2 Merge branch 'post-02' into post-03 2019-12-12 09:23:30 +01:00
Philipp Oppermann
0cc02f02c5 Merge branch 'post-01' into post-02 2019-12-12 09:23:30 +01:00
Philipp Oppermann
adcb547765 Update to x86_64 0.8.1 2019-12-10 17:31:21 +01:00
Philipp Oppermann
faf097fd06 Merge branch 'post-03' into post-04 2019-12-10 16:55:36 +01:00
Philipp Oppermann
dbb3db2dc7 Merge branch 'post-02' into post-03 2019-12-10 16:55:29 +01:00
Philipp Oppermann
58629ea208 Merge branch 'post-01' into post-02 2019-12-10 16:55:26 +01:00
Philipp Oppermann
1636196d54 Merge pull request #701 from phil-opp/post-04-update
Update to x86_64 0.8.0
2019-12-10 16:54:51 +01:00
Philipp Oppermann
5c964dc7b9 Update to x86_64 0.8.0 2019-12-10 16:45:34 +01:00
Philipp Oppermann
0c3e6f95f6 Update post-04 to new lockfile format 2019-11-28 14:05:44 +01:00
Philipp Oppermann
23d8bb948e Merge branch 'post-03' into post-04 2019-11-28 14:05:02 +01:00
Philipp Oppermann
748365bf62 Update post-03 to new lockfile format 2019-11-28 14:04:38 +01:00
Philipp Oppermann
2b1f72ccd8 Merge branch 'post-02' into post-03 2019-11-28 14:04:16 +01:00
Philipp Oppermann
1c4ca04a2f Update post-02 to new lockfile format 2019-11-28 14:03:59 +01:00
Philipp Oppermann
60856aac6b Merge branch 'post-01' into post-02 2019-11-28 14:03:19 +01:00
Philipp Oppermann
ea998c9267 Merge branch 'post-03' into post-04 2019-11-22 15:57:18 +01:00
Philipp Oppermann
679e453509 Merge branch 'post-02' into post-03 2019-11-22 15:57:18 +01:00
Philipp Oppermann
7de138aa04 Merge branch 'post-01' into post-02 2019-11-22 15:57:18 +01:00
Philipp Oppermann
79ad84c502 Merge branch 'post-03' into post-04 2019-10-08 19:44:38 +02:00
Philipp Oppermann
4f90781b3f Merge branch 'post-02' into post-03 2019-10-08 19:44:38 +02:00
Philipp Oppermann
9e40f377db Merge branch 'post-01' into post-02 2019-10-08 19:44:38 +02:00
Philipp Oppermann
2a1f4d047c Run cargo update 2019-09-25 13:19:46 +02:00
Philipp Oppermann
01d9a028a3 Merge branch 'post-03' into post-04 2019-09-25 13:19:32 +02:00
Philipp Oppermann
515d98645e Merge branch 'post-02' into post-03 2019-09-25 13:18:58 +02:00
Philipp Oppermann
6b23fa3d28 Run cargo update 2019-09-25 13:18:32 +02:00
Philipp Oppermann
6e012e5e42 Merge branch 'post-03' into post-04 2019-09-13 17:43:20 +02:00
Philipp Oppermann
a86fe5c2af Merge branch 'post-02' into post-03 2019-09-13 17:42:32 +02:00
Philipp Oppermann
99a7231d52 Remove profile.{dev, release}.panic keys from Cargo.toml 2019-09-13 17:42:06 +02:00
Philipp Oppermann
f4ed1fce81 Merge branch 'post-03' into post-04 2019-09-13 10:53:50 +02:00
Philipp Oppermann
ab10af6f99 Merge branch 'post-02' into post-03 2019-09-13 10:53:50 +02:00
Philipp Oppermann
621364bd1b Merge branch 'post-01' into post-02 2019-09-13 10:53:50 +02:00
Philipp Oppermann
086c3a02d3 Set x86_64 version to 0.7.5 2019-09-11 13:18:16 +02:00
Philipp Oppermann
14b38a3ea4 Merge branch 'post-03' into post-04 2019-09-11 13:14:02 +02:00
Philipp Oppermann
bcafb60069 Update spin and volatile dependencies 2019-09-11 13:13:34 +02:00
Philipp Oppermann
818bfb9646 Merge branch 'post-01' into post-02 2019-09-11 11:21:15 +02:00
Philipp Oppermann
b1121cdee2 Merge branch 'post-03' into post-04 2019-09-11 11:21:15 +02:00
Philipp Oppermann
465eb45cfe Merge branch 'post-02' into post-03 2019-09-11 11:21:15 +02:00
Philipp Oppermann
e27666cd75 Run cargo update 2019-09-11 10:57:58 +02:00
Philipp Oppermann
6771c2cc7f Merge branch 'post-03' into post-04 2019-09-11 10:57:21 +02:00
Philipp Oppermann
c6d5a4d567 Run cargo update 2019-09-11 10:57:07 +02:00
Philipp Oppermann
fe5e1fd92c Merge branch 'post-02' into post-03 2019-09-11 10:56:41 +02:00
Philipp Oppermann
ffd1bda509 Update bootloader to version 0.8.0 2019-09-11 10:55:49 +02:00
Philipp Oppermann
1d60156fce Merge branch 'post-03' into post-04 2019-09-11 10:32:57 +02:00
Philipp Oppermann
a1060f79f0 Merge branch 'post-02' into post-03 2019-09-11 10:32:57 +02:00
Philipp Oppermann
bb8923cf56 Merge branch 'post-01' into post-02 2019-09-11 10:32:57 +02:00
Philipp Oppermann
467300126b Merge branch 'post-03' into post-04 2019-09-11 10:12:46 +02:00
Philipp Oppermann
3765c27020 Merge branch 'post-02' into post-03 2019-09-11 10:12:46 +02:00
Philipp Oppermann
dbe0802c6d Merge branch 'post-01' into post-02 2019-09-11 10:12:46 +02:00
Philipp Oppermann
19b8ab1c4e Merge branch 'post-03' into post-04 2019-09-11 10:10:31 +02:00
Philipp Oppermann
70b339a4a5 Merge branch 'post-02' into post-03 2019-09-11 10:09:32 +02:00
Philipp Oppermann
9e1e3926fa Merge branch 'post-01' into post-02 2019-09-11 10:09:29 +02:00
Philipp Oppermann
f927742601 Merge pull request #663 from phil-opp/post-04-actions
Set up GitHub Actions for post-04 branch
2019-09-11 10:02:07 +02:00
Philipp Oppermann
210af19293 Github Actions: Install QEMU and run cargo xtest 2019-09-11 09:49:32 +02:00
Philipp Oppermann
6f90ee89fd Merge branch 'post-03' into post-04-actions 2019-09-11 09:47:01 +02:00
Philipp Oppermann
153beec1c4 Merge branch 'post-02' into post-03 2019-09-11 09:46:34 +02:00
Philipp Oppermann
7b00599bf8 Merge pull request #662 from phil-opp/post-02-actions
Set up GitHub Actions for post-02 branch
2019-09-11 09:45:20 +02:00
Philipp Oppermann
72aa3a4580 Update github actions script for post-02 2019-09-10 23:50:14 +02:00
Philipp Oppermann
5d7c4678de Merge branch 'post-01' into post-02-actions 2019-09-10 23:50:08 +02:00
Philipp Oppermann
20ef920fc6 Add [package.metadata.bootimage] again
Was accidentally removed when resolving a merge conflict.
2019-09-10 11:12:47 +02:00
Philipp Oppermann
9602f4e16d Merge branch 'post-03' into post-04 2019-09-10 10:21:08 +02:00
Philipp Oppermann
bfde53de79 Merge branch 'post-02' into post-03 2019-09-10 10:20:47 +02:00
Philipp Oppermann
7197d8b18a Remove old package.metadata.bootimage configuration key 2019-09-10 10:20:42 +02:00
Philipp Oppermann
d3e4c55fc5 Merge pull request #651 from phil-opp/post-04-update
Update post_04 branch for new should_panic test
2019-08-07 12:39:19 +02:00
Philipp Oppermann
f1ae82b220 Disable the test harness for the should_panic test 2019-08-07 11:02:19 +02:00
Philipp Oppermann
aad98c0611 Add a should_panic test 2019-08-07 11:00:01 +02:00
Philipp Oppermann
f98145d556 Delete panic handler test 2019-08-07 10:38:46 +02:00
Philipp Oppermann
99ea302aaa Regenerate Cargo.lock 2019-07-22 10:36:11 +02:00
Philipp Oppermann
133f73ab0b Merge branch 'post-03' into post-04 2019-07-22 10:34:02 +02:00
Philipp Oppermann
298ec5f4b6 Merge branch 'post-02' into post-03 2019-07-22 10:33:24 +02:00
Philipp Oppermann
e86c95bd24 Run cargo update 2019-07-22 10:24:54 +02:00
Philipp Oppermann
28d5eeb9c4 Run cargo update 2019-07-18 10:17:01 +02:00
Philipp Oppermann
5adfe28cf4 Merge branch 'post-03' into post-04 2019-07-18 10:16:43 +02:00
Philipp Oppermann
ff8afb814e Merge branch 'post-02' into post-03 2019-07-18 10:16:01 +02:00
Philipp Oppermann
47bcca33b3 Run cargo update 2019-07-18 10:14:57 +02:00
Philipp Oppermann
5ed27923e8 Update to bootloader 0.6.4 2019-07-18 10:14:39 +02:00
Philipp Oppermann
d2e0d38218 Run brew update on macOS to fix travis CI failure (#623) 2019-06-23 18:07:19 +02:00
Philipp Oppermann
7003268b9f Merge branch 'post-03' into post-04 2019-06-17 17:28:32 +02:00
Philipp Oppermann
fcd849f471 Fix deprecated range syntax 2019-06-17 17:28:27 +02:00
Philipp Oppermann
c8d1bbeef8 Update code for PR #611
PR at https://github.com/phil-opp/blog_os/pull/611
2019-05-22 12:43:15 +02:00
bors[bot]
158aed0c18 Merge #604 #606
604: Use `-serial stdio` instead of `-serial mon:stdio` r=phil-opp a=phil-opp

Fixes #602 

Post update in https://github.com/phil-opp/blog_os/pull/605

606: Update x86_64 to version 0.7.0 r=phil-opp a=phil-opp

[Changelog](https://github.com/rust-osdev/x86_64/blob/master/Changelog.md#070):

- **Breaking**: `Port::read` and `PortReadOnly::read` now take `&mut self` instead of `&self` ([#76](https://github.com/rust-osdev/x86_64/pull/76)).

Post update in https://github.com/phil-opp/blog_os/pull/607

Co-authored-by: Philipp Oppermann <dev@phil-opp.com>
2019-05-09 12:42:42 +00:00
Philipp Oppermann
3098be9653 Update x86_64 to version 0.7.0 2019-05-09 14:37:18 +02:00
Philipp Oppermann
86b57f696f Use -serial stdio instead of -serial mon:stdio 2019-05-08 16:10:23 +02:00
Philipp Oppermann
ac9b661395 Update to x86_64 0.6.0 2019-05-03 18:36:39 +02:00
Philipp Oppermann
ad99afae98 Fix panic_handler test by fixing line number 2019-04-26 13:42:20 +02:00
Philipp Oppermann
8374aa6ab6 Run cargo fmt 2019-04-26 13:42:20 +02:00
Philipp Oppermann
c8087cdd6f Update Readme for Testing post 2019-04-26 13:42:20 +02:00
Philipp Oppermann
ccb8b79ef8 Add a panic handler test 2019-04-26 13:42:20 +02:00
Philipp Oppermann
a55ced6b7f Add a basic test to basic_boot 2019-04-26 13:42:20 +02:00
Philipp Oppermann
2e5f192f35 Make exit_qemu safe 2019-04-26 13:42:20 +02:00
Philipp Oppermann
c2f36e086e Install qemu on CI 2019-04-26 13:42:10 +02:00
Philipp Oppermann
cdd91df869 Run cargo xtest on CI 2019-04-26 13:42:04 +02:00
Philipp Oppermann
a2d628cabe Complete the basic_boot integration test 2019-04-26 13:41:19 +02:00
Philipp Oppermann
48e1f72d23 Split off a library 2019-04-26 13:41:19 +02:00
Philipp Oppermann
3b13211579 Add the skeleton for an integration test 2019-04-26 13:41:19 +02:00
Philipp Oppermann
d0629ba5a2 Import serial_println only in test mode 2019-04-26 13:41:19 +02:00
Philipp Oppermann
46bb44b95d Run cargo fmt 2019-04-26 13:41:19 +02:00
Philipp Oppermann
4cbac20b40 Add tests for the VGA buffer 2019-04-26 13:41:19 +02:00
Philipp Oppermann
d4ebbc291a Hide QEMU in test mode 2019-04-26 13:41:19 +02:00
Philipp Oppermann
3ecf9a9b56 Exit qemu on panic 2019-04-26 13:41:19 +02:00
Philipp Oppermann
1559493802 Print test results over serial port 2019-04-26 13:41:19 +02:00
Philipp Oppermann
98a0e605be Interpret exit code 33 as test success 2019-04-26 13:41:19 +02:00
Philipp Oppermann
dbdd46da9a Exit qemu after running tests 2019-04-26 13:41:17 +02:00
Philipp Oppermann
3aa6151729 Add a trivial_assertion test 2019-04-26 13:41:07 +02:00
Philipp Oppermann
0beb0d80f8 Add a custom test runner 2019-04-26 13:41:07 +02:00
Philipp Oppermann
3c421e9ccb Merge branch 'post-03-new' into post-04-new 2019-04-26 12:46:01 +02:00
Philipp Oppermann
23cbafab1c Reset code to post-03 branch 2019-04-26 12:44:33 +02:00
Philipp Oppermann
70c24b76d0 Merge branch 'post-02' into post-03 2019-04-26 11:27:45 +02:00
Philipp Oppermann
b59720f6e1 Update Readme for new runner 2019-04-26 11:27:36 +02:00
Philipp Oppermann
16a314ab8d Merge branch 'post-02' into post-03 2019-04-26 11:24:17 +02:00
Philipp Oppermann
63b97fe1f8 Update bootloader to version 0.6.0 2019-04-26 11:23:32 +02:00
Philipp Oppermann
528bbd4e9f Add a cargo xbuild check on CI 2019-04-25 14:28:43 +02:00
Philipp Oppermann
06d1c9ff81 Update CI scripts to use cargo bootimage 2019-04-25 14:17:27 +02:00
Philipp Oppermann
c1064ad316 Add a .cargo/config file 2019-04-25 13:18:28 +02:00
Philipp Oppermann
4eb7f94171 Merge branch 'post-03' into post-04 2019-04-25 11:08:11 +02:00
Philipp Oppermann
f875a933e5 Merge branch 'post-02' into post-03 2019-04-25 11:08:11 +02:00
Philipp Oppermann
3c2a5ef0f6 Merge branch 'post-01' into post-02 2019-04-25 11:08:11 +02:00
Philipp Oppermann
d497d12649 Merge branch 'post-03' into post-04 2019-04-11 15:32:21 +02:00
Philipp Oppermann
652d91154f Merge branch 'post-02' into post-03 2019-04-11 15:32:21 +02:00
Philipp Oppermann
64e7ea7b1a Merge branch 'post-01' into post-02 2019-04-11 15:32:06 +02:00
Philipp Oppermann
66f79fa254 Merge branch 'post-03' into post-04 2019-04-06 17:35:16 +02:00
Philipp Oppermann
9a879e69c5 Merge branch 'post-02' into post-03 2019-04-06 17:35:16 +02:00
Philipp Oppermann
eee4718115 Add llvm-tools-preview also in travis and appveyor scripts 2019-04-06 17:35:11 +02:00
Philipp Oppermann
5422f555cf Merge branch 'post-03' into post-04 2019-04-06 16:55:46 +02:00
Philipp Oppermann
186321623a Run cargo update 2019-04-06 16:55:17 +02:00
Philipp Oppermann
1246fc4df9 Merge branch 'post-02' into post-03 2019-04-06 16:54:48 +02:00
Philipp Oppermann
9237c875f3 Run cargo update 2019-04-06 16:53:52 +02:00
Philipp Oppermann
ceaa5c2dab Merge branch 'post-03' into post-04 2019-04-06 16:48:32 +02:00
Philipp Oppermann
03da22d8e1 Merge branch 'post-02' into post-03 2019-04-06 16:47:45 +02:00
Philipp Oppermann
62b89cd80f Install llvm-tools-preview rustup component 2019-04-06 16:37:43 +02:00
Philipp Oppermann
e1034aa9ac Update Cargo.lock 2019-04-06 15:34:23 +02:00
Philipp Oppermann
577c6b8cfc Update to bootloader 0.5.1 2019-04-06 15:33:13 +02:00
Philipp Oppermann
768c09dffe Merge branch 'post-03' into post-04
# Conflicts:
#	README.md
2019-04-03 10:46:10 +02:00
Philipp Oppermann
d98a4d0cbc Merge branch 'post-02' into post-03
# Conflicts:
#	README.md
2019-04-03 10:45:48 +02:00
Philipp Oppermann
f308628db2 Merge branch 'post-01' into post-02 2019-04-03 10:45:28 +02:00
Philipp Oppermann
cc949a2ef3 Merge branch 'post-03' into post-04 2019-03-14 11:15:56 +01:00
Philipp Oppermann
93b2134692 Merge branch 'post-02' into post-03 2019-03-14 11:14:01 +01:00
Philipp Oppermann
ab16203ed7 Update bootloader to version 0.4.0 2019-03-14 11:13:28 +01:00
Philipp Oppermann
c6aaa66420 Merge branch 'post-03' into post-04 2019-02-25 16:35:03 +01:00
Philipp Oppermann
4d405d5098 Merge branch 'post-02' into post-03 2019-02-25 16:34:15 +01:00
Philipp Oppermann
63f8f3a6eb Merge branch 'post-01' into post-02 2019-02-25 16:34:15 +01:00
Philipp Oppermann
0bec03e080 Merge branch 'post-03' into post-04 2019-02-07 18:46:32 +01:00
Philipp Oppermann
e3f9cd42b0 Merge branch 'post-02' into post-03 2019-02-07 18:46:32 +01:00
Philipp Oppermann
013e6f2add Merge branch 'post-01' into post-02 2019-02-07 18:46:31 +01:00
Philipp Oppermann
71099663ad Merge branch 'post-03' into post-04 2019-02-07 16:15:10 +01:00
Philipp Oppermann
61f524f040 Merge branch 'post-02' into post-03 2019-02-07 16:15:10 +01:00
Philipp Oppermann
d5cb74ac8b We still need nighly Rust for the second and later posts 2019-02-07 16:14:58 +01:00
Philipp Oppermann
3bf2c66acc Merge branch 'post-01' into post-02 2019-02-07 16:11:46 +01:00
Philipp Oppermann
a53f0573d8 Merge branch 'post-03' into post-04 2019-02-05 15:23:48 +01:00
Philipp Oppermann
3f9072e8b5 Merge branch 'post-02' into post-03 2019-02-05 15:23:48 +01:00
Philipp Oppermann
0e6ffc1a4f Merge branch 'post-01' into post-02 2019-02-05 15:23:48 +01:00
Philipp Oppermann
b71e0644bf Update azure pipelines script for unit testing post 2019-02-05 14:57:46 +01:00
Philipp Oppermann
078aebe32a Merge branch 'post-03' into post-04 2019-02-05 14:55:54 +01:00
Philipp Oppermann
bac4a3c549 Merge branch 'post-02' into post-03 2019-02-05 14:55:29 +01:00
Philipp Oppermann
57484164ab Expand azure pipelines script for second post 2019-02-05 14:55:22 +01:00
Philipp Oppermann
1ca8cec4e6 Merge branch 'post-01' into post-02 2019-02-05 14:53:53 +01:00
Philipp Oppermann
afc89c9e4c Merge branch 'post-03' into post-04 2019-02-05 10:46:08 +01:00
Philipp Oppermann
4bfcea2368 Merge branch 'post-02' into post-03 2019-02-05 10:46:08 +01:00
Philipp Oppermann
2d5d6ee850 Merge branch 'post-01' into post-02 2019-02-05 10:46:08 +01:00
Philipp Oppermann
2db616bd7d Merge branch 'post-03' into post-04 2019-02-05 10:45:11 +01:00
Philipp Oppermann
af0b258279 Make vga_buffer::{ScreenChar, Buffer} repr(transparent) 2019-02-05 10:44:52 +01:00
Philipp Oppermann
c9ce9d5735 Merge branch 'post-01' into post-02 2019-01-29 12:16:54 +01:00
Philipp Oppermann
237a848459 Merge branch 'post-03' into post-04 2019-01-29 12:16:54 +01:00
Philipp Oppermann
de2b99f0d2 Merge branch 'post-02' into post-03 2019-01-29 12:16:54 +01:00
Philipp Oppermann
053216ffd4 Make array-init a dev-dependency 2019-01-28 11:40:00 +01:00
Philipp Oppermann
61d10d686b Update Readme for Unit Testing post 2019-01-27 17:08:41 +01:00
Philipp Oppermann
52bc8ea29f Merge branch 'post-03' into post-04 2019-01-27 17:08:15 +01:00
Philipp Oppermann
8c1e98752a Update Readme for VGA Text Mode post 2019-01-27 17:07:48 +01:00
Philipp Oppermann
ceb5cf4eed Merge branch 'post-02' into post-03 2019-01-27 17:07:24 +01:00
Philipp Oppermann
f013172dd7 Update Readme for A Minimal Rust Kernel post 2019-01-27 17:06:41 +01:00
Philipp Oppermann
858a2f94c6 Merge branch 'post-01' into post-02 2019-01-27 17:06:09 +01:00
Philipp Oppermann
5b3e3642ca Merge branch 'post-03' into post-04 2019-01-27 16:33:54 +01:00
Philipp Oppermann
1d5bc372a0 Merge branch 'post-02' into post-03 2019-01-27 16:33:54 +01:00
Philipp Oppermann
2ce4af4a65 Merge branch 'post-01' into post-02 2019-01-27 16:33:54 +01:00
Philipp Oppermann
d516dac0c3 Update CI scripts for unit testing post 2019-01-27 15:43:18 +01:00
Philipp Oppermann
c0fcb5f922 Merge branch 'z_post_03' into z_post_04 2019-01-27 15:42:59 +01:00
Philipp Oppermann
0874a50544 Merge branch 'z_post_02' into z_post_03 2019-01-27 15:37:53 +01:00
Philipp Oppermann
8d730050d3 Update CI scripts for second post 2019-01-27 15:27:16 +01:00
Philipp Oppermann
752a7ed84e Merge branch 'z_post_01' into z_post_02 2019-01-27 15:22:55 +01:00
Philipp Oppermann
be46130322 Merge branch 'z_post_03' into z_post_04 2019-01-25 14:45:46 +01:00
Philipp Oppermann
b5c05193e1 Document vga buffer methods 2019-01-25 14:39:47 +01:00
Philipp Oppermann
76110c1dd8 Add a write_formatted test 2019-01-25 13:32:00 +01:00
Philipp Oppermann
92c4206e86 Add a write_byte test 2019-01-25 13:31:34 +01:00
Philipp Oppermann
a15e01f2eb Construct a vga buffer for testing 2019-01-25 13:31:06 +01:00
Philipp Oppermann
76a65ca3ee Include the standard library for unit tests 2019-01-25 13:29:02 +01:00
Philipp Oppermann
8e74084d52 Silence unused import warnings for cargo test 2019-01-25 13:25:24 +01:00
Philipp Oppermann
5366fe2ff8 Make cargo test work 2019-01-25 13:24:54 +01:00
Philipp Oppermann
6c427e7cee Print the PanicInfo on panic 2019-01-25 13:23:04 +01:00
Philipp Oppermann
c43d6191c5 Implement print!/println! macros 2019-01-25 13:22:33 +01:00
Philipp Oppermann
c1e3fa57c6 Add a global interface 2019-01-25 13:21:39 +01:00
Philipp Oppermann
3574958d5f Implement new_line method 2019-01-25 13:18:58 +01:00
Philipp Oppermann
cbfe6221bd Implement support for Rust's formatting macros 2019-01-25 13:18:13 +01:00
Philipp Oppermann
d1897af515 Use volatile writes for accessing the VGA buffer 2019-01-25 13:16:44 +01:00
Philipp Oppermann
59f9fe1e69 Update Cargo.lock 2019-01-25 12:44:36 +01:00
Philipp Oppermann
f4fd0e264a Add default target for bootimage 2019-01-25 12:44:27 +01:00
Philipp Oppermann
bbc19e132c Add bootloader dependency 2019-01-25 12:42:48 +01:00
Philipp Oppermann
f9ffee92c7 Print Hello World! to screen 2019-01-25 12:42:21 +01:00
Philipp Oppermann
fd08b1a123 Add target specification file 2019-01-25 12:40:20 +01:00
Philipp Oppermann
d71e6a7cb6 Test the vga buffer module through a print_something function 2019-01-25 12:26:05 +01:00
Philipp Oppermann
27f2c4c2ff Add methods to write bytes and strings 2019-01-25 12:25:46 +01:00
Philipp Oppermann
19de9e560d Add a VGA buffer module 2019-01-25 12:21:51 +01:00
13 changed files with 596 additions and 25 deletions

9
.cargo/config.toml Normal file
View File

@@ -0,0 +1,9 @@
[unstable]
build-std = ["core", "compiler_builtins"]
build-std-features = ["compiler-builtins-mem"]
[build]
target = "x86_64-blog_os.json"
[target.'cfg(target_os = "none")']
runner = "bootimage runner"

View File

@@ -56,21 +56,41 @@ jobs:
with:
profile: minimal
toolchain: nightly
- name: Install bootimage
run: cargo install bootimage --debug
- name: Checkout Repository
uses: actions/checkout@v2
- name: Add thumbv7em-none-eabihf Target
run: rustup target add thumbv7em-none-eabihf
- name: Build for thumbv7em-none-eabihf
run: cargo build --target thumbv7em-none-eabihf
- name: Build for Linux
- name: Install Rustup Components
run: rustup component add rust-src llvm-tools-preview
- name: Run `cargo bootimage`
uses: actions-rs/cargo@v1
with:
command: bootimage
# install QEMU
- name: Install QEMU (Linux)
run: sudo apt update && sudo apt install qemu-system-x86
if: runner.os == 'Linux'
run: cargo rustc -- -C link-arg=-nostartfiles
- name: Build for macOS
- name: Install QEMU (macOS)
run: brew install qemu
if: runner.os == 'macOS'
run: cargo rustc -- -C link-args="-e __start -static -nostartfiles"
- name: Build for Windows
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
- name: Install QEMU (Windows)
run: |
choco install qemu --version 2021.5.5
echo "$Env:Programfiles\qemu" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: runner.os == 'Windows'
run: cargo rustc -- -C link-args="/ENTRY:_start /SUBSYSTEM:console"
shell: pwsh
- name: "Print QEMU Version"
run: qemu-system-x86_64 --version
- name: Run `cargo test`
uses: actions-rs/cargo@v1
with:
command: test
check_formatting:
name: Check Formatting

96
Cargo.lock generated
View File

@@ -1,7 +1,101 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "bit_field"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a65b545ab31d687cff52899d4890855fec459eb6afe0da6417b8a18da87aa29"
[[package]]
name = "blog_os"
version = "0.1.0"
dependencies = [
"bootloader",
"lazy_static",
"spin 0.5.2",
"uart_16550",
"volatile 0.2.7",
"x86_64",
]
[[package]]
name = "bootloader"
version = "0.9.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bdfddac270bbdd45903296bc1caf29a7fdce6b326aaf0bbab7f04c5f98b7447"
[[package]]
name = "lazy_static"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
dependencies = [
"spin 0.9.8",
]
[[package]]
name = "rustversion"
version = "1.0.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
[[package]]
name = "spin"
version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]]
name = "spin"
version = "0.9.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67"
[[package]]
name = "uart_16550"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "614ff2a87880d4bd4374722268598a970bbad05ced8bf630439417347254ab2e"
dependencies = [
"bitflags 1.3.2",
"rustversion",
"x86_64",
]
[[package]]
name = "volatile"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6b06ad3ed06fef1713569d547cdbdb439eafed76341820fb0e0344f29a41945"
[[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.14.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c101112411baafbb4bf8d33e4c4a80ab5b02d74d2612331c61e8192fc9710491"
dependencies = [
"bit_field",
"bitflags 2.9.2",
"rustversion",
"volatile 0.4.6",
]

View File

@@ -4,15 +4,34 @@ version = "0.1.0"
authors = ["Philipp Oppermann <dev@phil-opp.com>"]
edition = "2024"
[[test]]
name = "should_panic"
harness = false
[dependencies]
bootloader = "0.9"
volatile = "0.2.6"
spin = "0.5.2"
x86_64 = "0.14.2"
uart_16550 = "0.2.0"
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
[dependencies.lazy_static]
version = "1.0"
features = ["spin_no_std"]
[[bin]]
name = "blog_os"
test = false
test = true
bench = false
[package.metadata.bootimage]
test-args = [
"-device",
"isa-debug-exit,iobase=0xf4,iosize=0x04",
"-serial",
"stdio",
"-display",
"none",
]
test-success-exit-code = 33 # (0x10 << 1) | 1

View File

@@ -1,25 +1,65 @@
# Blog OS (A Freestanding Rust Binary)
# Blog OS (Testing)
[![Build Status](https://github.com/phil-opp/blog_os/workflows/Code/badge.svg?branch=post-01)](https://github.com/phil-opp/blog_os/actions?query=workflow%3A%22Code%22+branch%3Apost-01)
[![Build Status](https://github.com/phil-opp/blog_os/workflows/Code/badge.svg?branch=post-04)](https://github.com/phil-opp/blog_os/actions?query=workflow%3A%22Code%22+branch%3Apost-04)
This repository contains the source code for the [A Freestanding Rust Binary][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series.
This repository contains the source code for the [Testing][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series.
[post]: https://os.phil-opp.com/freestanding-rust-binary/
[post]: https://os.phil-opp.com/testing/
**Check out the [master branch](https://github.com/phil-opp/blog_os) for more information.**
## Building
To build the project on Linux, run:
This project requires a nightly version of Rust because it uses some unstable features. At least nightly _2020-07-15_ is required for building. You might need to run `rustup update nightly --force` to update to the latest nightly even if some components such as `rustfmt` are missing it.
You can build the project by running:
```
cargo rustc -- -Clink-arg=-nostartfiles
cargo build
```
The entry point and the build command differ slightly on macOS and Windows. See the [post] for more information.
To create a bootable disk image from the compiled kernel, you need to install the [`bootimage`] tool:
[`bootimage`]: https://github.com/rust-osdev/bootimage
```
cargo install bootimage
```
After installing, you can create the bootable disk image by running:
```
cargo bootimage
```
This creates a bootable disk image in the `target/x86_64-blog_os/debug` directory.
Please file an issue if you have any problems.
## Running
You can run the disk image in [QEMU] through:
[QEMU]: https://www.qemu.org/
```
cargo run
```
[QEMU] and the [`bootimage`] tool need to be installed for this.
You can also write the image to an USB stick for booting it on a real machine. On Linux, the command for this is:
```
dd if=target/x86_64-blog_os/debug/bootimage-blog_os.bin of=/dev/sdX && sync
```
Where `sdX` is the device name of your USB stick. **Be careful** to choose the correct device name, because everything on that device is overwritten.
## Testing
To run the unit and integration tests, execute `cargo xtest`.
## License
Licensed under either of

1
rust-toolchain Normal file
View File

@@ -0,0 +1 @@
nightly

70
src/lib.rs Normal file
View File

@@ -0,0 +1,70 @@
#![no_std]
#![cfg_attr(test, no_main)]
#![feature(custom_test_frameworks)]
#![test_runner(crate::test_runner)]
#![reexport_test_harness_main = "test_main"]
use core::panic::PanicInfo;
pub mod serial;
pub mod vga_buffer;
pub trait Testable {
fn run(&self) -> ();
}
impl<T> Testable for T
where
T: Fn(),
{
fn run(&self) {
serial_print!("{}...\t", core::any::type_name::<T>());
self();
serial_println!("[ok]");
}
}
pub fn test_runner(tests: &[&dyn Testable]) {
serial_println!("Running {} tests", tests.len());
for test in tests {
test.run();
}
exit_qemu(QemuExitCode::Success);
}
pub fn test_panic_handler(info: &PanicInfo) -> ! {
serial_println!("[failed]\n");
serial_println!("Error: {}\n", info);
exit_qemu(QemuExitCode::Failed);
loop {}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u32)]
pub enum QemuExitCode {
Success = 0x10,
Failed = 0x11,
}
pub fn exit_qemu(exit_code: QemuExitCode) {
use x86_64::instructions::port::Port;
unsafe {
let mut port = Port::new(0xf4);
port.write(exit_code as u32);
}
}
/// Entry point for `cargo xtest`
#[cfg(test)]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
test_main();
loop {}
}
#[cfg(test)]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
test_panic_handler(info)
}

View File

@@ -1,15 +1,37 @@
#![no_std]
#![no_main]
#![feature(custom_test_frameworks)]
#![test_runner(blog_os::test_runner)]
#![reexport_test_harness_main = "test_main"]
use blog_os::println;
use core::panic::PanicInfo;
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
println!("Hello World{}", "!");
#[cfg(test)]
test_main();
loop {}
}
/// This function is called on panic.
#[cfg(not(test))]
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
fn panic(info: &PanicInfo) -> ! {
println!("{}", info);
loop {}
}
#[cfg(test)]
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
blog_os::test_panic_handler(info)
}
#[test_case]
fn trivial_assertion() {
assert_eq!(1, 1);
}

37
src/serial.rs Normal file
View File

@@ -0,0 +1,37 @@
use lazy_static::lazy_static;
use spin::Mutex;
use uart_16550::SerialPort;
lazy_static! {
pub static ref SERIAL1: Mutex<SerialPort> = {
let mut serial_port = unsafe { SerialPort::new(0x3F8) };
serial_port.init();
Mutex::new(serial_port)
};
}
#[doc(hidden)]
pub fn _print(args: ::core::fmt::Arguments) {
use core::fmt::Write;
SERIAL1
.lock()
.write_fmt(args)
.expect("Printing to serial failed");
}
/// Prints to the host through the serial interface.
#[macro_export]
macro_rules! serial_print {
($($arg:tt)*) => {
$crate::serial::_print(format_args!($($arg)*));
};
}
/// Prints to the host through the serial interface, appending a newline.
#[macro_export]
macro_rules! serial_println {
() => ($crate::serial_print!("\n"));
($fmt:expr) => ($crate::serial_print!(concat!($fmt, "\n")));
($fmt:expr, $($arg:tt)*) => ($crate::serial_print!(
concat!($fmt, "\n"), $($arg)*));
}

193
src/vga_buffer.rs Normal file
View File

@@ -0,0 +1,193 @@
use core::fmt;
use lazy_static::lazy_static;
use spin::Mutex;
use volatile::Volatile;
lazy_static! {
/// A global `Writer` instance that can be used for printing to the VGA text buffer.
///
/// Used by the `print!` and `println!` macros.
pub static ref WRITER: Mutex<Writer> = Mutex::new(Writer {
column_position: 0,
color_code: ColorCode::new(Color::Yellow, Color::Black),
buffer: unsafe { &mut *(0xb8000 as *mut Buffer) },
});
}
/// The standard color palette in VGA text mode.
#[allow(dead_code)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(u8)]
pub enum Color {
Black = 0,
Blue = 1,
Green = 2,
Cyan = 3,
Red = 4,
Magenta = 5,
Brown = 6,
LightGray = 7,
DarkGray = 8,
LightBlue = 9,
LightGreen = 10,
LightCyan = 11,
LightRed = 12,
Pink = 13,
Yellow = 14,
White = 15,
}
/// A combination of a foreground and a background color.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(transparent)]
struct ColorCode(u8);
impl ColorCode {
/// Create a new `ColorCode` with the given foreground and background colors.
fn new(foreground: Color, background: Color) -> ColorCode {
ColorCode((background as u8) << 4 | (foreground as u8))
}
}
/// A screen character in the VGA text buffer, consisting of an ASCII character and a `ColorCode`.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(C)]
struct ScreenChar {
ascii_character: u8,
color_code: ColorCode,
}
/// The height of the text buffer (normally 25 lines).
const BUFFER_HEIGHT: usize = 25;
/// The width of the text buffer (normally 80 columns).
const BUFFER_WIDTH: usize = 80;
/// A structure representing the VGA text buffer.
#[repr(transparent)]
struct Buffer {
chars: [[Volatile<ScreenChar>; BUFFER_WIDTH]; BUFFER_HEIGHT],
}
/// A writer type that allows writing ASCII bytes and strings to an underlying `Buffer`.
///
/// Wraps lines at `BUFFER_WIDTH`. Supports newline characters and implements the
/// `core::fmt::Write` trait.
pub struct Writer {
column_position: usize,
color_code: ColorCode,
buffer: &'static mut Buffer,
}
impl Writer {
/// Writes an ASCII byte to the buffer.
///
/// Wraps lines at `BUFFER_WIDTH`. Supports the `\n` newline character.
pub fn write_byte(&mut self, byte: u8) {
match byte {
b'\n' => self.new_line(),
byte => {
if self.column_position >= BUFFER_WIDTH {
self.new_line();
}
let row = BUFFER_HEIGHT - 1;
let col = self.column_position;
let color_code = self.color_code;
self.buffer.chars[row][col].write(ScreenChar {
ascii_character: byte,
color_code,
});
self.column_position += 1;
}
}
}
/// Writes the given ASCII string to the buffer.
///
/// Wraps lines at `BUFFER_WIDTH`. Supports the `\n` newline character. Does **not**
/// support strings with non-ASCII characters, since they can't be printed in the VGA text
/// mode.
fn write_string(&mut self, s: &str) {
for byte in s.bytes() {
match byte {
// printable ASCII byte or newline
0x20..=0x7e | b'\n' => self.write_byte(byte),
// not part of printable ASCII range
_ => self.write_byte(0xfe),
}
}
}
/// Shifts all lines one line up and clears the last row.
fn new_line(&mut self) {
for row in 1..BUFFER_HEIGHT {
for col in 0..BUFFER_WIDTH {
let character = self.buffer.chars[row][col].read();
self.buffer.chars[row - 1][col].write(character);
}
}
self.clear_row(BUFFER_HEIGHT - 1);
self.column_position = 0;
}
/// Clears a row by overwriting it with blank characters.
fn clear_row(&mut self, row: usize) {
let blank = ScreenChar {
ascii_character: b' ',
color_code: self.color_code,
};
for col in 0..BUFFER_WIDTH {
self.buffer.chars[row][col].write(blank);
}
}
}
impl fmt::Write for Writer {
fn write_str(&mut self, s: &str) -> fmt::Result {
self.write_string(s);
Ok(())
}
}
/// Like the `print!` macro in the standard library, but prints to the VGA text buffer.
#[macro_export]
macro_rules! print {
($($arg:tt)*) => ($crate::vga_buffer::_print(format_args!($($arg)*)));
}
/// Like the `println!` macro in the standard library, but prints to the VGA text buffer.
#[macro_export]
macro_rules! println {
() => ($crate::print!("\n"));
($($arg:tt)*) => ($crate::print!("{}\n", format_args!($($arg)*)));
}
/// Prints the given formatted string to the VGA text buffer through the global `WRITER` instance.
#[doc(hidden)]
pub fn _print(args: fmt::Arguments) {
use core::fmt::Write;
WRITER.lock().write_fmt(args).unwrap();
}
#[test_case]
fn test_println_simple() {
println!("test_println_simple output");
}
#[test_case]
fn test_println_many() {
for _ in 0..200 {
println!("test_println_many output");
}
}
#[test_case]
fn test_println_output() {
let s = "Some test string that fits on a single line";
println!("{}", s);
for (i, c) in s.chars().enumerate() {
let screen_char = WRITER.lock().buffer.chars[BUFFER_HEIGHT - 2][i].read();
assert_eq!(char::from(screen_char.ascii_character), c);
}
}

25
tests/basic_boot.rs Normal file
View File

@@ -0,0 +1,25 @@
#![no_std]
#![no_main]
#![feature(custom_test_frameworks)]
#![test_runner(blog_os::test_runner)]
#![reexport_test_harness_main = "test_main"]
use blog_os::println;
use core::panic::PanicInfo;
#[unsafe(no_mangle)] // don't mangle the name of this function
pub extern "C" fn _start() -> ! {
test_main();
loop {}
}
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
blog_os::test_panic_handler(info)
}
#[test_case]
fn test_println() {
println!("test_println output");
}

25
tests/should_panic.rs Normal file
View File

@@ -0,0 +1,25 @@
#![no_std]
#![no_main]
use blog_os::{QemuExitCode, exit_qemu, serial_print, serial_println};
use core::panic::PanicInfo;
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
should_fail();
serial_println!("[test did not panic]");
exit_qemu(QemuExitCode::Failed);
loop {}
}
fn should_fail() {
serial_print!("should_panic::should_fail...\t");
assert_eq!(0, 1);
}
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
serial_println!("[ok]");
exit_qemu(QemuExitCode::Success);
loop {}
}

16
x86_64-blog_os.json Normal file
View File

@@ -0,0 +1,16 @@
{
"llvm-target": "x86_64-unknown-none",
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
"arch": "x86_64",
"target-endian": "little",
"target-pointer-width": 64,
"target-c-int-width": 32,
"os": "none",
"executables": true,
"linker-flavor": "ld.lld",
"linker": "rust-lld",
"panic-strategy": "abort",
"disable-redzone": true,
"features": "-mmx,-sse,+soft-float",
"rustc-abi": "x86-softfloat"
}