Compare commits

..

285 Commits

Author SHA1 Message Date
Philipp Oppermann
86352f9b8f Merge branch 'post-05' into post-06 2025-08-18 09:44:29 +02:00
Philipp Oppermann
a862287880 Merge branch 'post-04' into post-05 2025-08-18 09:44:29 +02:00
Philipp Oppermann
f4c35f7091 Merge branch 'post-05' into post-06 2025-08-07 13:09:45 +02:00
Philipp Oppermann
d46aef945f Merge branch 'post-04' into post-05 2025-08-07 13:09:45 +02:00
Philipp Oppermann
41f4b88041 Merge branch 'post-05' into post-06 2025-08-07 13:08:03 +02:00
Philipp Oppermann
e24e33f6ff Merge branch 'post-04' into post-05 2025-08-07 13:08:03 +02:00
Philipp Oppermann
c407c26224 Run cargo fmt 2025-03-27 16:13:18 +01:00
Philipp Oppermann
5b088bffeb Update stack_overflow test to use unsafe no_mangle attribute
Required since Rust 2024 edition
2025-03-27 15:51:13 +01:00
Philipp Oppermann
e9ca6b83c4 Merge branch 'post-05' into post-06 2025-03-27 15:50:40 +01:00
Philipp Oppermann
62b2c8a0b5 Merge branch 'post-04' into post-05 2025-03-27 15:50:18 +01:00
Philipp Oppermann
3d94346f43 Merge branch 'post-05' into post-06 2025-03-27 15:13:48 +01:00
Philipp Oppermann
f19372d58a Merge branch 'post-04' into post-05 2025-03-27 15:13:48 +01:00
Philipp Oppermann
caa829db01 Merge branch 'post-05' into post-06 2025-03-24 11:09:24 +01:00
Philipp Oppermann
168dc5c2be Merge branch 'post-04' into post-05 2025-03-24 11:09:24 +01:00
Philipp Oppermann
90d1551665 Merge branch 'post-05' into post-06 2025-02-10 12:36:07 +01:00
Philipp Oppermann
45c058c622 Merge branch 'post-04' into post-05 2025-02-10 12:36:07 +01:00
Philipp Oppermann
e9f9035f89 Merge branch 'post-05' into post-06 2025-02-10 11:16:21 +01:00
Philipp Oppermann
1d87e3b699 Merge branch 'post-04' into post-05 2025-02-10 11:16:21 +01:00
Philipp Oppermann
aa9d0fff74 Code: Use new &raw const operator instead of unsafe {& _} 2025-01-15 19:58:23 +01:00
Philipp Oppermann
6854937268 Merge branch 'post-04' into post-05 2024-04-30 15:39:16 +02:00
Philipp Oppermann
61fc3c65bc Merge branch 'post-05' into post-06 2024-04-30 15:39:16 +02:00
Philipp Oppermann
a44ac64c10 Merge branch 'post-04' into post-05 2024-02-16 15:59:40 +01:00
Philipp Oppermann
27888e99b5 Merge branch 'post-05' into post-06 2024-02-16 15:59:40 +01:00
Philipp Oppermann
defd01c032 Merge branch 'post-04' into post-05 2024-02-16 13:22:06 +01:00
Philipp Oppermann
26222f866f Merge branch 'post-05' into post-06 2024-02-16 13:22:06 +01:00
Philipp Oppermann
45a8a03449 Merge branch 'post-04' into post-05 2024-02-16 13:14:09 +01:00
Philipp Oppermann
d61a13bbad Merge branch 'post-05' into post-06 2024-02-16 13:14:09 +01:00
Philipp Oppermann
5cb7baa983 Merge branch 'post-04' into post-05 2024-02-16 12:39:56 +01:00
Philipp Oppermann
8b7d009ba5 Merge branch 'post-05' into post-06 2024-02-16 12:39:56 +01:00
Philipp Oppermann
67c3180a7f Merge branch 'post-04' into post-05 2024-01-28 11:45:38 +01:00
Philipp Oppermann
431a956388 Merge branch 'post-05' into post-06 2024-01-28 11:45:38 +01:00
Philipp Oppermann
3adc1cc476 Merge branch 'post-04' into post-05 2022-09-25 11:32:07 +02:00
Philipp Oppermann
698ccaf6d7 Merge branch 'post-05' into post-06 2022-09-25 11:32:07 +02:00
ruhuang
b72c457481 Update post-06 to set CS register with non-deprecated function (#1099)
Set CS register with non-deprecated function
2022-04-08 10:05:21 +02:00
Philipp Oppermann
e85f81b828 Merge branch 'post-04' into post-05 2022-01-18 10:06:44 +01:00
Philipp Oppermann
4a684a06b1 Merge branch 'post-05' into post-06 2022-01-18 10:06:44 +01:00
Philipp Oppermann
31b6cf52c6 Merge branch 'post-04' into post-05 2021-12-22 09:27:53 +01:00
Philipp Oppermann
a9d6066fb7 Merge branch 'post-05' into post-06 2021-12-22 09:27:53 +01:00
Philipp Oppermann
688e9680aa Merge branch 'post-04' into post-05 2021-12-21 13:56:10 +01:00
Philipp Oppermann
8b6a53973b Merge branch 'post-05' into post-06 2021-12-21 13:56:10 +01:00
Philipp Oppermann
624579b494 Merge branch 'post-04' into post-05 2021-08-22 14:44:44 +02:00
Philipp Oppermann
f0ed4260e1 Merge branch 'post-05' into post-06 2021-08-22 14:44:44 +02:00
Philipp Oppermann
6c97986b38 Merge branch 'post-05' into post-06 2021-05-21 19:56:04 +02:00
Philipp Oppermann
0ee96f8178 Merge branch 'post-04' into post-05 2021-05-21 19:55:41 +02:00
Philipp Oppermann
1990d09e80 Merge branch 'post-05' into post-06 2021-05-20 14:33:10 +02:00
Philipp Oppermann
a78e4b36f1 Merge branch 'post-04' into post-05 2021-05-20 14:33:10 +02:00
Philipp Oppermann
d55fa1ee24 Adjust post-06 to take InterruptStackFrame by value 2021-05-17 11:46:24 +02:00
Philipp Oppermann
5ae0f13fa4 Merge branch 'post-05' into post-06 2021-05-17 11:44:50 +02:00
Philipp Oppermann
4804317b24 Take InterruptStackFrame by value as required by x86_64 v0.14 2021-05-17 11:43:22 +02:00
Philipp Oppermann
91f75922ca Merge branch 'post-05' into post-06 2021-05-17 11:41:30 +02:00
Philipp Oppermann
d3cb8115c5 Merge branch 'post-04' into post-05 2021-05-17 11:41:30 +02:00
Philipp Oppermann
a7943b8d05 Merge branch 'post-05' into post-06 2021-05-17 11:30:02 +02:00
Philipp Oppermann
85fe11c95c Merge branch 'post-04' into post-05 2021-05-17 11:30:02 +02:00
Philipp Oppermann
69c22017ce Merge branch 'post-05' into post-06 2021-05-17 11:29:23 +02:00
Philipp Oppermann
e48031e8bf Merge branch 'post-04' into post-05 2021-05-17 11:29:23 +02:00
Philipp Oppermann
9bc237ac70 Merge branch 'post-05' into post-06 2021-03-10 09:23:02 +01:00
Philipp Oppermann
489d337cec Merge branch 'post-04' into post-05 2021-03-10 09:23:02 +01:00
Philipp Oppermann
4815290f89 Merge branch 'post-05' into post-06 2021-03-10 09:15:58 +01:00
Philipp Oppermann
163cadf121 Merge branch 'post-04' into post-05 2021-03-10 09:15:58 +01:00
Philipp Oppermann
79a05fb802 Merge branch 'post-05' into post-06 2021-03-10 09:13:39 +01:00
Philipp Oppermann
009356771a Merge branch 'post-04' into post-05 2021-03-10 09:13:39 +01:00
Philipp Oppermann
b74317b35a Merge branch 'post-05' into post-06 2021-03-10 08:53:42 +01:00
Philipp Oppermann
f1f358a684 Merge branch 'post-04' into post-05 2021-03-10 08:53:42 +01:00
Philipp Oppermann
4f9ec9427c Merge branch 'post-05' into post-06 2021-02-02 11:06:37 +01:00
Philipp Oppermann
67d9426fc7 Merge branch 'post-04' into post-05 2021-02-02 11:06:37 +01:00
Philipp Oppermann
01701384f0 Merge branch 'post-05' into post-06 2021-02-02 10:52:06 +01:00
Philipp Oppermann
eb85142b45 Merge branch 'post-04' into post-05 2021-02-02 10:52:06 +01:00
Philipp Oppermann
ab691c47d7 Merge branch 'post-05' into post-06 2020-11-22 13:46:58 +01:00
Philipp Oppermann
2b739350a8 Merge branch 'post-04' into post-05 2020-11-22 13:46:57 +01:00
Philipp Oppermann
31c0412d0d Merge branch 'post-05' into post-06 2020-10-02 23:35:26 +02:00
Philipp Oppermann
d26b91121c Merge branch 'post-04' into post-05 2020-10-02 23:35:26 +02:00
Philipp Oppermann
f7198d2b00 Merge branch 'post-05' into post-06 2020-09-29 12:22:06 +02:00
Philipp Oppermann
3230ab7538 Merge branch 'post-04' into post-05 2020-09-29 12:22:06 +02:00
Philipp Oppermann
de8d1cb632 Merge branch 'post-05' into post-06 2020-09-29 12:19:54 +02:00
Philipp Oppermann
7e3ef2075d Merge branch 'post-04' into post-05 2020-09-29 12:19:54 +02:00
Philipp Oppermann
b471610fa3 Merge branch 'post-05' into post-06 2020-09-24 10:27:12 +02:00
Philipp Oppermann
da14329fb2 Merge branch 'post-04' into post-05 2020-09-24 10:26:41 +02:00
Philipp Oppermann
9a7d089cf7 Merge branch 'post-05' into post-06 2020-09-24 09:09:39 +02:00
Philipp Oppermann
d8ba61748f Merge branch 'post-04' into post-05 2020-09-24 09:09:22 +02:00
Philipp Oppermann
7056923ef7 Merge branch 'post-05' into post-06 2020-08-16 18:03:09 +02:00
Philipp Oppermann
f591b959f5 Merge branch 'post-04' into post-05 2020-08-16 18:03:09 +02:00
Philipp Oppermann
817e36c064 Increase double fault stack size 2020-08-16 17:57:43 +02:00
Philipp Oppermann
a0e428cc8c Merge branch 'post-04' into post-05 2020-07-17 15:57:35 +02:00
Philipp Oppermann
18bc113726 Merge branch 'post-05' into post-06 2020-07-17 15:57:35 +02:00
Philipp Oppermann
b90e5fb32a Merge branch 'post-04' into post-05 2020-07-17 11:48:35 +02:00
Philipp Oppermann
70458b6f6f Merge branch 'post-05' into post-06 2020-07-17 11:48:35 +02:00
Philipp Oppermann
b7fb1e8764 Merge branch 'post-04' into post-05 2020-07-17 11:28:04 +02:00
Philipp Oppermann
51f8e413d5 Merge branch 'post-05' into post-06 2020-07-17 11:28:04 +02:00
Philipp Oppermann
1876a78058 Merge branch 'post-05' into post-06 2020-07-17 11:23:28 +02:00
Philipp Oppermann
3ac92cf275 Merge branch 'post-04' into post-05 2020-07-17 11:23:27 +02:00
Philipp Oppermann
0dd32e2680 Merge pull request #818 from phil-opp/post-06-prevent-tail-recursion
Do a volatile read in stack_overflow test to avoid tail recursion
2020-06-08 12:29:58 +02:00
Philipp Oppermann
5735cb8ec0 Do a volatile read in stack_overflow test to avoid tail recursion
This prevents the compiler from transforming the tail recursive function into a loop, which does not lead to a stack overflow. It also avoids the LLVM bug where functions with side-effect-free endless loops are removed. Thus, the test now also works in `--release` mode.
2020-06-08 12:17:06 +02:00
Philipp Oppermann
12d94fd2e9 Adjust stack_overflow test print message 2020-06-08 12:01:04 +02:00
Philipp Oppermann
8c10bbb096 Merge branch 'post-05' into post-06 2020-06-08 11:57:12 +02:00
Philipp Oppermann
7846bd0559 Remove superfluous printing from test_breakpoint_exception 2020-06-08 11:55:24 +02:00
Philipp Oppermann
3ccc602e38 Merge branch 'post-04' into post-05 2020-06-08 11:53:01 +02:00
Philipp Oppermann
f9446883e2 Merge branch 'post-05' into post-06 2020-05-20 14:56:19 +02:00
Philipp Oppermann
735210fc8f Merge branch 'post-04' into post-05 2020-05-20 14:56:19 +02:00
Philipp Oppermann
2bf84f60e9 Merge branch 'post-05' into post-06 2020-05-20 14:25:56 +02:00
Philipp Oppermann
0d506d5dd5 Merge branch 'post-04' into post-05 2020-05-20 14:25:23 +02:00
Philipp Oppermann
bfed1f44e2 Merge branch 'post-05' into post-06 2020-05-20 14:06:06 +02:00
Philipp Oppermann
158873acd4 Merge branch 'post-04' into post-05 2020-05-20 14:05:29 +02:00
Philipp Oppermann
8a4f3ab2a8 Merge branch 'post-05' into post-06 2020-03-08 14:39:37 +01:00
Philipp Oppermann
e402af005b Merge branch 'post-04' into post-05 2020-03-08 14:39:37 +01:00
Philipp Oppermann
dbe1353fd2 Merge branch 'post-05' into post-06 2020-03-08 14:27:42 +01:00
Philipp Oppermann
813bc41a74 Merge branch 'post-04' into post-05 2020-03-08 14:27:42 +01:00
Philipp Oppermann
16afb268f8 Merge branch 'post-05' into post-06 2020-02-26 12:46:19 +01:00
Philipp Oppermann
5ef73aaa30 Merge branch 'post-04' into post-05 2020-02-26 12:46:09 +01:00
Philipp Oppermann
c211412ce2 Update Github Actions badge for post-06 2019-12-12 09:30:51 +01:00
Philipp Oppermann
93d3de6feb Merge branch 'post-05' into post-06 2019-12-12 09:30:37 +01:00
Philipp Oppermann
6dcf5c61fb Update Github Actions badge for post-05 2019-12-12 09:30:17 +01:00
Philipp Oppermann
96683c596b Merge branch 'post-04' into post-05 2019-12-12 09:30:03 +01:00
Philipp Oppermann
651c629ffd Merge branch 'post-05' into post-06 2019-12-12 09:23:30 +01:00
Philipp Oppermann
5ac91e5e38 Merge branch 'post-04' into post-05 2019-12-12 09:23:30 +01:00
Philipp Oppermann
8d8a7e0973 Merge branch 'post-05' into post-06 2019-12-10 17:31:24 +01:00
Philipp Oppermann
ec933ab329 Merge branch 'post-04' into post-05 2019-12-10 17:31:24 +01:00
Philipp Oppermann
423b6e49cc Merge pull request #702 from phil-opp/post-06-fix
Make double fault handlers diverging
2019-12-10 17:17:00 +01:00
Philipp Oppermann
d1cf8000a3 Make double fault handlers diverging
Required by x86_64 0.8.0.
2019-12-10 17:02:46 +01:00
Philipp Oppermann
76483ab6bf Merge branch 'post-04' into post-05 2019-12-10 16:55:41 +01:00
Philipp Oppermann
16c499f966 Merge branch 'post-05' into post-06 2019-12-10 16:55:41 +01:00
Philipp Oppermann
9d6ba0d31e Merge branch 'post-05' into post-06 2019-11-28 14:06:28 +01:00
Philipp Oppermann
3a65487f17 Merge branch 'post-04' into post-05 2019-11-28 14:06:08 +01:00
Philipp Oppermann
590585da33 Merge branch 'post-05' into post-06 2019-11-25 13:24:09 +01:00
Philipp Oppermann
6828849bc4 Remove cfg(not(windows)) from interrupt module
This is no longer required and was already removed from the post in commit 992b958414.
2019-11-25 13:19:07 +01:00
Philipp Oppermann
a604e1fa14 Merge branch 'post-06' of github.com:phil-opp/blog_os into post-06 2019-11-22 16:04:09 +01:00
Philipp Oppermann
29063f4531 Merge branch 'post-04' into post-05 2019-11-22 15:57:18 +01:00
Philipp Oppermann
05c3a17c49 Merge branch 'post-05' into post-06 2019-11-22 15:57:18 +01:00
Philipp Oppermann
3470636653 Use panic! instead of println! + loop in double fault handler (#687)
This avoids an endless loop when a double fault occurs while running `cargo xtest`.
2019-11-22 15:56:56 +01:00
Philipp Oppermann
6979a125cf Merge branch 'post-04' into post-05 2019-10-08 19:44:38 +02:00
Philipp Oppermann
1a1ce5120f Merge branch 'post-05' into post-06 2019-10-08 19:44:38 +02:00
Philipp Oppermann
78fdba7606 Merge branch 'post-05' into post-06 2019-09-25 13:20:13 +02:00
Philipp Oppermann
215900cb39 Merge branch 'post-04' into post-05 2019-09-25 13:19:55 +02:00
Philipp Oppermann
8d6915beba Merge branch 'post-05' into post-06 2019-09-13 17:43:25 +02:00
Philipp Oppermann
df1e2c1c41 Merge branch 'post-04' into post-05 2019-09-13 17:43:25 +02:00
Philipp Oppermann
0eaaa3ff2b Merge branch 'post-05' into post-06 2019-09-13 10:53:50 +02:00
Philipp Oppermann
b851eb01a8 Merge branch 'post-04' into post-05 2019-09-13 10:53:50 +02:00
Philipp Oppermann
086304c9c4 Merge branch 'post-05' into post-06 2019-09-11 13:18:19 +02:00
Philipp Oppermann
3f8c629f28 Merge branch 'post-04' into post-05 2019-09-11 13:18:19 +02:00
Philipp Oppermann
2e27b91220 Merge branch 'post-05' into post-06 2019-09-11 11:21:15 +02:00
Philipp Oppermann
06929ee840 Merge branch 'post-04' into post-05 2019-09-11 11:21:15 +02:00
Philipp Oppermann
cb77074476 Merge branch 'post-05' into post-06 2019-09-11 10:58:02 +02:00
Philipp Oppermann
e43daca563 Merge branch 'post-04' into post-05 2019-09-11 10:58:02 +02:00
Philipp Oppermann
d0afb95b50 Merge branch 'post-05' into post-06 2019-09-11 10:32:57 +02:00
Philipp Oppermann
baa2c3b445 Merge branch 'post-04' into post-05 2019-09-11 10:32:57 +02:00
Philipp Oppermann
1b0378f87e Merge branch 'post-05' into post-06 2019-09-11 10:12:46 +02:00
Philipp Oppermann
c58570fbea Merge branch 'post-04' into post-05 2019-09-11 10:12:46 +02:00
Philipp Oppermann
b91f71784d Merge branch 'post-05' into post-06 2019-09-11 10:11:25 +02:00
Philipp Oppermann
17c3138763 Merge branch 'post-04' into post-05 2019-09-11 10:10:49 +02:00
Philipp Oppermann
6316a0e1df Merge branch 'post-05' into post-06 2019-09-11 10:02:41 +02:00
Philipp Oppermann
d85274ca2a Merge branch 'post-04' into post-05 2019-09-11 10:02:41 +02:00
Philipp Oppermann
38cfb5e324 Merge branch 'post-05' into post-06 2019-09-10 11:12:54 +02:00
Philipp Oppermann
aa084dd539 Merge branch 'post-04' into post-05 2019-09-10 11:12:54 +02:00
Philipp Oppermann
a9921e9448 Merge branch 'post-05' into post-06 2019-09-10 10:21:14 +02:00
Philipp Oppermann
0d87aa7e98 Merge branch 'post-04' into post-05 2019-09-10 10:21:14 +02:00
Philipp Oppermann
9770d481f2 Merge branch 'post-05' into post-06 2019-08-07 12:40:04 +02:00
Philipp Oppermann
6797b2b70e Merge branch 'post-04' into post-05 2019-08-07 12:40:04 +02:00
Philipp Oppermann
7baa3b0155 Merge branch 'post-05' into post-06 2019-07-22 10:36:23 +02:00
Philipp Oppermann
752a65e4da Merge branch 'post-04' into post-05 2019-07-22 10:36:23 +02:00
Philipp Oppermann
08bf4405a9 Merge branch 'post-05' into post-06 2019-07-18 10:17:05 +02:00
Philipp Oppermann
b6683d95ec Merge branch 'post-04' into post-05 2019-07-18 10:17:05 +02:00
Philipp Oppermann
9d5b5f33f1 Merge branch 'post-05' into post-06 2019-06-23 18:07:34 +02:00
Philipp Oppermann
a7710b3d5c Merge branch 'post-04' into post-05 2019-06-23 18:07:34 +02:00
Philipp Oppermann
9b4b810bd3 Merge branch 'post-05' into post-06 2019-06-17 17:28:32 +02:00
Philipp Oppermann
618d10eac8 Merge branch 'post-04' into post-05 2019-06-17 17:28:32 +02:00
Philipp Oppermann
7a45083975 Merge branch 'post-05' into post-06 2019-05-23 12:39:35 +02:00
Philipp Oppermann
2faeaa8964 Merge branch 'post-04' into post-05 2019-05-23 12:39:35 +02:00
Philipp Oppermann
01040fc643 Merge branch 'post-05' into post-06 2019-05-09 14:59:55 +02:00
Philipp Oppermann
2dfc5e838a Merge branch 'post-04' into post-05 2019-05-09 14:59:55 +02:00
Philipp Oppermann
5a68816b45 Merge branch 'post-05' into post-06 2019-05-03 18:36:45 +02:00
Philipp Oppermann
12c08d72e4 Merge branch 'post-04' into post-05 2019-05-03 18:36:45 +02:00
Philipp Oppermann
111c3e1029 Comment out stack_overflow() call to keep cargo xtest working 2019-04-26 15:48:59 +02:00
Philipp Oppermann
70d981e179 Simplify stack_overflow test 2019-04-26 15:14:38 +02:00
Philipp Oppermann
ee3d2219ab Disable test harness for stack_overflow test 2019-04-26 15:14:38 +02:00
Philipp Oppermann
c5a39e0902 Add a stack overflow integration test 2019-04-26 15:14:38 +02:00
Philipp Oppermann
4774893a93 Call gdt::init from blog_os::init 2019-04-26 15:14:38 +02:00
Philipp Oppermann
3c59321b54 Remove old bootimage test integration test 2019-04-26 15:14:38 +02:00
Philipp Oppermann
f5345db3e6 Update post number for Readme badge 2019-04-26 15:11:49 +02:00
Philipp Oppermann
94622ebfd5 Merge branch 'post-05-new' into post-06-new-rebased 2019-04-26 15:11:24 +02:00
Philipp Oppermann
53f3236754 Update post number for Readme badge 2019-04-26 15:09:17 +02:00
Philipp Oppermann
82014268da Merge branch 'post-05-new' into post-06-new-rebased 2019-04-26 15:05:55 +02:00
Philipp Oppermann
a5b6422785 Add a test for the breakpoint exception 2019-04-26 14:57:14 +02:00
Philipp Oppermann
b7eefae5f9 Delete old bootimage test integration tests 2019-04-26 14:57:14 +02:00
Philipp Oppermann
df8335f8c7 Add a new blog_os::init function instead of calling init_idt directly 2019-04-26 14:57:14 +02:00
Philipp Oppermann
f301ae461a Merge branch 'post-04-new' into post-05-new 2019-04-26 14:56:25 +02:00
Philipp Oppermann
e0d68fee24 Merge branch 'post-06' into post-07 2019-04-25 11:08:11 +02:00
Philipp Oppermann
8f76952ff0 Merge branch 'post-05' into post-06 2019-04-25 11:08:11 +02:00
Philipp Oppermann
57b30bf346 Merge branch 'post-04' into post-05 2019-04-25 11:08:11 +02:00
Philipp Oppermann
6f623dc7b4 Merge branch 'post-06' into post-07 2019-04-11 15:32:21 +02:00
Philipp Oppermann
c6ebca363b Merge branch 'post-05' into post-06 2019-04-11 15:32:21 +02:00
Philipp Oppermann
3bbc72f92b Merge branch 'post-04' into post-05 2019-04-11 15:32:21 +02:00
Philipp Oppermann
dc1f862177 Merge branch 'post-06' into post-07 2019-04-06 17:35:17 +02:00
Philipp Oppermann
f5996c1e22 Merge branch 'post-05' into post-06 2019-04-06 17:35:17 +02:00
Philipp Oppermann
eafcd8b269 Merge branch 'post-04' into post-05 2019-04-06 17:35:17 +02:00
Philipp Oppermann
fdf0fe617b Merge branch 'post-06' into post-07 2019-04-06 17:31:13 +02:00
Philipp Oppermann
daf5ed954d Merge branch 'post-05' into post-06 2019-04-06 17:30:54 +02:00
Philipp Oppermann
4753c0e1c8 Run cargo update 2019-04-06 17:30:31 +02:00
Philipp Oppermann
dddc314b7c Merge branch 'post-04' into post-05 2019-04-06 17:27:37 +02:00
Philipp Oppermann
23fcb9f20b Merge branch 'post-06' into post-07 2019-04-06 16:49:01 +02:00
Philipp Oppermann
5531e437c4 Merge branch 'post-05' into post-06 2019-04-06 16:49:01 +02:00
Philipp Oppermann
0cd92f9567 Merge branch 'post-04' into post-05 2019-04-06 16:48:51 +02:00
Philipp Oppermann
ffb76038bc Merge branch 'post-06' into post-07
# Conflicts:
#	README.md
2019-04-03 10:46:46 +02:00
Philipp Oppermann
555a76b559 Merge branch 'post-05' into post-06
# Conflicts:
#	README.md
2019-04-03 10:46:34 +02:00
Philipp Oppermann
802c7151e4 Merge branch 'post-04' into post-05
# Conflicts:
#	README.md
2019-04-03 10:46:23 +02:00
Philipp Oppermann
f42461b99b Merge branch 'post-06' into post-07 2019-03-26 13:26:56 +01:00
Philipp Oppermann
19db8f6095 Merge branch 'post-05' into post-06 2019-03-26 13:26:56 +01:00
Philipp Oppermann
3a273540f4 CI: Run apt update before installing qemu 2019-03-26 13:26:24 +01:00
Philipp Oppermann
701823742e Merge branch 'post-06' into post-07 2019-03-14 11:18:22 +01:00
Philipp Oppermann
ea096a561a Merge branch 'post-05' into post-06 2019-03-14 11:18:22 +01:00
Philipp Oppermann
6d45ffd4d7 Merge branch 'post-04' into post-05 2019-03-14 11:17:58 +01:00
Philipp Oppermann
b533bf6596 Merge branch 'post-06' into post-07 2019-03-12 17:48:11 +01:00
Philipp Oppermann
7648993b8f Merge branch 'post-05' into post-06 2019-03-12 17:48:11 +01:00
Philipp Oppermann
17bd271573 Update x86_64 to version 0.5.2 2019-03-12 17:45:09 +01:00
Philipp Oppermann
1ed76411f7 Fix remaining use of ExceptionStackFrame in test 2019-03-09 14:21:03 +01:00
Philipp Oppermann
8e5b6a3e3f Update post-07 code for changes in x86_64 0.5.0 2019-03-09 12:34:49 +01:00
Philipp Oppermann
be0ed3a54d Merge branch 'post-06' into post-07 2019-03-09 12:32:03 +01:00
Philipp Oppermann
b895f8c745 Update code for changes in x86_64 0.5.0 2019-03-09 12:29:44 +01:00
Philipp Oppermann
eee9d7b899 Merge branch 'post-05' into post-06 2019-03-09 12:10:27 +01:00
Philipp Oppermann
9787e6dce6 Update to x86_64 0.5.0 2019-03-09 12:10:18 +01:00
Philipp Oppermann
f5b6094521 Merge branch 'post-06' into post-07 2019-02-25 16:37:30 +01:00
Philipp Oppermann
a4f675739a Merge branch 'post-05' into post-06 2019-02-25 16:37:30 +01:00
Philipp Oppermann
b1cca8de88 Merge branch 'post-04' into post-05 2019-02-25 16:37:18 +01:00
Philipp Oppermann
38bd9a65b6 Merge branch 'post-06' into post-07 2019-02-07 18:46:32 +01:00
Philipp Oppermann
493fcb5d84 Merge branch 'post-05' into post-06 2019-02-07 18:46:32 +01:00
Philipp Oppermann
b651214f1e Merge branch 'post-04' into post-05 2019-02-07 18:46:32 +01:00
Philipp Oppermann
b3e94470e4 Merge branch 'post-06' into post-07 2019-02-07 16:15:10 +01:00
Philipp Oppermann
3fca470487 Merge branch 'post-05' into post-06 2019-02-07 16:15:10 +01:00
Philipp Oppermann
bac8703e04 Merge branch 'post-04' into post-05 2019-02-07 16:15:10 +01:00
Philipp Oppermann
7b01e9c862 Merge branch 'post-06' into post-07 2019-02-05 15:23:49 +01:00
Philipp Oppermann
290ee927e8 Merge branch 'post-05' into post-06 2019-02-05 15:23:49 +01:00
Philipp Oppermann
99171b003e Merge branch 'post-04' into post-05 2019-02-05 15:23:49 +01:00
Philipp Oppermann
5452e0f455 Merge branch 'post-06' into post-07 2019-02-05 14:59:15 +01:00
Philipp Oppermann
86b17ea139 Merge branch 'post-05' into post-06 2019-02-05 14:59:15 +01:00
Philipp Oppermann
f15bbaea3f Update azure pipelines script for integration tests 2019-02-05 14:58:51 +01:00
Philipp Oppermann
b66b7563c2 Merge branch 'post-04' into post-05 2019-02-05 14:58:20 +01:00
Philipp Oppermann
202902f30d Merge branch 'post-06' into post-07 2019-02-05 10:46:08 +01:00
Philipp Oppermann
223ce459a1 Merge branch 'post-05' into post-06 2019-02-05 10:46:08 +01:00
Philipp Oppermann
d808cbff94 Merge branch 'post-04' into post-05 2019-02-05 10:46:08 +01:00
Philipp Oppermann
3bb30fd1e8 Merge branch 'post-06' into post-07 2019-02-05 10:45:12 +01:00
Philipp Oppermann
62e2cee989 Merge branch 'post-05' into post-06 2019-02-05 10:45:12 +01:00
Philipp Oppermann
69ab78108b Merge branch 'post-04' into post-05 2019-02-05 10:45:12 +01:00
Philipp Oppermann
41e36b4afa Merge branch 'post-06' into post-07 2019-01-29 12:16:54 +01:00
Philipp Oppermann
a7ada29c5e Merge branch 'post-05' into post-06 2019-01-29 12:16:54 +01:00
Philipp Oppermann
968620dce8 Merge branch 'post-04' into post-05 2019-01-29 12:16:54 +01:00
Philipp Oppermann
f76ec1ae32 Only set double fault handler once 2019-01-28 11:50:59 +01:00
Philipp Oppermann
1a801e3d35 Merge branch 'post-05' into post-06 2019-01-28 11:44:14 +01:00
Philipp Oppermann
efe92e5004 Merge branch 'post-06' into post-07 2019-01-28 11:44:14 +01:00
Philipp Oppermann
f0580e82a1 Merge branch 'post-04' into post-05 2019-01-28 11:42:39 +01:00
Philipp Oppermann
233943310c Update Readme for Double Faults post 2019-01-27 17:12:21 +01:00
Philipp Oppermann
ef6d69f82b Merge branch 'post-06' into post-07 2019-01-27 17:11:38 +01:00
Philipp Oppermann
94014b5a39 Update Readme for CPU Exceptions post 2019-01-27 17:11:08 +01:00
Philipp Oppermann
680aab362e Merge branch 'post-05' into post-06 2019-01-27 17:10:50 +01:00
Philipp Oppermann
92cc34712c Update Readme for Integration Tests post 2019-01-27 17:09:37 +01:00
Philipp Oppermann
bdbbd219d0 Merge branch 'post-04' into post-05 2019-01-27 17:09:11 +01:00
Philipp Oppermann
637b517f47 Merge branch 'post-06' into post-07 2019-01-27 16:33:54 +01:00
Philipp Oppermann
ab8d8b46e2 Merge branch 'post-05' into post-06 2019-01-27 16:33:54 +01:00
Philipp Oppermann
3cd7427ed8 Merge branch 'post-04' into post-05 2019-01-27 16:33:54 +01:00
Philipp Oppermann
5802c97938 Merge branch 'z_post_06' into z_post_07 2019-01-27 15:46:59 +01:00
Philipp Oppermann
33f9f14391 Merge branch 'z_post_05' into z_post_06 2019-01-27 15:46:59 +01:00
Philipp Oppermann
68d09db7c5 Update CI scripts for integration test post 2019-01-27 15:46:08 +01:00
Philipp Oppermann
6bbd12ba7a Merge branch 'z_post_04' into z_post_05 2019-01-27 15:44:11 +01:00
Philipp Oppermann
29ee6b15dd Merge branch 'z_post_06' into z_post_07 2019-01-27 14:28:55 +01:00
Philipp Oppermann
15b394f0eb Merge branch 'z_post_05' into z_post_06 2019-01-27 14:28:51 +01:00
Philipp Oppermann
17f2699277 Update to x86_64 0.4.0 2019-01-27 14:12:10 +01:00
Philipp Oppermann
90ad333e90 Merge branch 'z_post_06' into z_post_07 2019-01-25 14:46:29 +01:00
Philipp Oppermann
cc3a868863 Merge branch 'z_post_05' into z_post_06 2019-01-25 14:46:17 +01:00
Philipp Oppermann
d1545e7fbf Merge branch 'z_post_04' into z_post_05 2019-01-25 14:46:04 +01:00
Philipp Oppermann
afe8dc3dcf Add stack overflow integration test 2019-01-25 14:45:02 +01:00
Philipp Oppermann
8bb0187f35 Run rustfmt 2019-01-25 14:44:42 +01:00
Philipp Oppermann
e0ed423e52 Explain the LLVM bug on Windows in more detail 2019-01-25 14:37:46 +01:00
Philipp Oppermann
d8edfccca4 Set the stack_index for the double fault handler 2019-01-25 14:01:29 +01:00
Philipp Oppermann
ff25a7d86c Reload code and TSS selector registers 2019-01-25 13:59:09 +01:00
Philipp Oppermann
b5202e26a1 Load the GDT 2019-01-25 13:57:40 +01:00
Philipp Oppermann
ea1b031fd3 Create a static GDT 2019-01-25 13:57:08 +01:00
Philipp Oppermann
db4e879c34 Create a new GDT module and a static TSS 2019-01-25 13:56:40 +01:00
Philipp Oppermann
7fd29c9cbe Trigger a double fault through a stack overflow -> triple fault 2019-01-25 13:55:42 +01:00
Philipp Oppermann
218cb9399e Add a double fault handler and test it 2019-01-25 13:54:44 +01:00
Philipp Oppermann
b96636984c Workaround an LLVM bug 2019-01-25 13:53:17 +01:00
Philipp Oppermann
b9dd088dc1 Create test-exception-breakpoint integration test 2019-01-25 13:51:39 +01:00
Philipp Oppermann
c6bd48e812 Load and test our new IDT 2019-01-25 13:51:06 +01:00
Philipp Oppermann
9448b0e025 Create a new IDT 2019-01-25 13:49:09 +01:00
Philipp Oppermann
ade6c99885 Add an interrupts module 2019-01-25 13:47:28 +01:00
Philipp Oppermann
59579108a7 Add test-basic-boot and test-panic integration tests 2019-01-25 13:45:38 +01:00
Philipp Oppermann
bd39105793 Split crate into lib.rs and main.rs 2019-01-25 13:44:04 +01:00
Philipp Oppermann
d007aae993 Exit qemu 2019-01-25 13:38:26 +01:00
Philipp Oppermann
c21f051300 Add a serial module 2019-01-25 13:37:20 +01:00
9 changed files with 177 additions and 8 deletions

4
Cargo.lock generated
View File

@@ -34,9 +34,9 @@ dependencies = [
[[package]]
name = "bootloader"
version = "0.9.33"
version = "0.9.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7bdfddac270bbdd45903296bc1caf29a7fdce6b326aaf0bbab7f04c5f98b7447"
checksum = "1ea119c3ed05625c179e09d17d0914570a3753ca09c890a73d98f6b72aea00d2"
[[package]]
name = "lazy_static"

View File

@@ -8,6 +8,10 @@ edition = "2024"
name = "should_panic"
harness = false
[[test]]
name = "stack_overflow"
harness = false
[dependencies]
bootloader = "0.9"
volatile = "0.2.6"
@@ -21,7 +25,7 @@ features = ["spin_no_std"]
[[bin]]
name = "blog_os"
test = true
test = false
bench = false

View File

@@ -1,10 +1,10 @@
# Blog OS (Testing)
# Blog OS (Double Faults)
[![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)
[![Build Status](https://github.com/phil-opp/blog_os/workflows/Code/badge.svg?branch=post-06)](https://github.com/phil-opp/blog_os/actions?query=workflow%3A%22Code%22+branch%3Apost-06)
This repository contains the source code for the [Testing][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series.
This repository contains the source code for the [Double Faults][post] post of the [Writing an OS in Rust](https://os.phil-opp.com) series.
[post]: https://os.phil-opp.com/testing/
[post]: https://os.phil-opp.com/double-fault-exceptions/
**Check out the [master branch](https://github.com/phil-opp/blog_os) for more information.**

52
src/gdt.rs Normal file
View File

@@ -0,0 +1,52 @@
use lazy_static::lazy_static;
use x86_64::VirtAddr;
use x86_64::structures::gdt::{Descriptor, GlobalDescriptorTable, SegmentSelector};
use x86_64::structures::tss::TaskStateSegment;
pub const DOUBLE_FAULT_IST_INDEX: u16 = 0;
lazy_static! {
static ref TSS: TaskStateSegment = {
let mut tss = TaskStateSegment::new();
tss.interrupt_stack_table[DOUBLE_FAULT_IST_INDEX as usize] = {
const STACK_SIZE: usize = 4096 * 5;
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;
stack_end
};
tss
};
}
lazy_static! {
static ref GDT: (GlobalDescriptorTable, Selectors) = {
let mut gdt = GlobalDescriptorTable::new();
let code_selector = gdt.add_entry(Descriptor::kernel_code_segment());
let tss_selector = gdt.add_entry(Descriptor::tss_segment(&TSS));
(
gdt,
Selectors {
code_selector,
tss_selector,
},
)
};
}
struct Selectors {
code_selector: SegmentSelector,
tss_selector: SegmentSelector,
}
pub fn init() {
use x86_64::instructions::segmentation::{CS, Segment};
use x86_64::instructions::tables::load_tss;
GDT.0.load();
unsafe {
CS::set_reg(GDT.1.code_selector);
load_tss(GDT.1.tss_selector);
}
}

37
src/interrupts.rs Normal file
View File

@@ -0,0 +1,37 @@
use crate::{gdt, println};
use lazy_static::lazy_static;
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
lazy_static! {
static ref IDT: InterruptDescriptorTable = {
let mut idt = InterruptDescriptorTable::new();
idt.breakpoint.set_handler_fn(breakpoint_handler);
unsafe {
idt.double_fault
.set_handler_fn(double_fault_handler)
.set_stack_index(gdt::DOUBLE_FAULT_IST_INDEX);
}
idt
};
}
pub fn init_idt() {
IDT.load();
}
extern "x86-interrupt" fn breakpoint_handler(stack_frame: InterruptStackFrame) {
println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
}
extern "x86-interrupt" fn double_fault_handler(
stack_frame: InterruptStackFrame,
_error_code: u64,
) -> ! {
panic!("EXCEPTION: DOUBLE FAULT\n{:#?}", stack_frame);
}
#[test_case]
fn test_breakpoint_exception() {
// invoke a breakpoint exception
x86_64::instructions::interrupts::int3();
}

View File

@@ -1,14 +1,21 @@
#![no_std]
#![cfg_attr(test, no_main)]
#![feature(custom_test_frameworks)]
#![feature(abi_x86_interrupt)]
#![test_runner(crate::test_runner)]
#![reexport_test_harness_main = "test_main"]
use core::panic::PanicInfo;
pub mod gdt;
pub mod interrupts;
pub mod serial;
pub mod vga_buffer;
pub fn init() {
gdt::init();
interrupts::init_idt();
}
pub trait Testable {
fn run(&self) -> ();
}
@@ -59,6 +66,7 @@ pub fn exit_qemu(exit_code: QemuExitCode) {
#[cfg(test)]
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
init();
test_main();
loop {}
}

View File

@@ -11,9 +11,19 @@ use core::panic::PanicInfo;
pub extern "C" fn _start() -> ! {
println!("Hello World{}", "!");
blog_os::init();
fn stack_overflow() {
stack_overflow(); // for each recursion, the return address is pushed
}
// uncomment line below to trigger a stack overflow
// stack_overflow();
#[cfg(test)]
test_main();
println!("It did not crash!");
loop {}
}

58
tests/stack_overflow.rs Normal file
View File

@@ -0,0 +1,58 @@
#![no_std]
#![no_main]
#![feature(abi_x86_interrupt)]
use blog_os::{QemuExitCode, exit_qemu, serial_print, serial_println};
use core::panic::PanicInfo;
use lazy_static::lazy_static;
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
#[unsafe(no_mangle)]
pub extern "C" fn _start() -> ! {
serial_print!("stack_overflow::stack_overflow...\t");
blog_os::gdt::init();
init_test_idt();
// trigger a stack overflow
stack_overflow();
panic!("Execution continued after stack overflow");
}
#[allow(unconditional_recursion)]
fn stack_overflow() {
stack_overflow(); // for each recursion, the return address is pushed
volatile::Volatile::new(0).read(); // prevent tail recursion optimizations
}
lazy_static! {
static ref TEST_IDT: InterruptDescriptorTable = {
let mut idt = InterruptDescriptorTable::new();
unsafe {
idt.double_fault
.set_handler_fn(test_double_fault_handler)
.set_stack_index(blog_os::gdt::DOUBLE_FAULT_IST_INDEX);
}
idt
};
}
pub fn init_test_idt() {
TEST_IDT.load();
}
extern "x86-interrupt" fn test_double_fault_handler(
_stack_frame: InterruptStackFrame,
_error_code: u64,
) -> ! {
serial_println!("[ok]");
exit_qemu(QemuExitCode::Success);
loop {}
}
#[panic_handler]
fn panic(info: &PanicInfo) -> ! {
blog_os::test_panic_handler(info)
}

View File

@@ -3,7 +3,7 @@
"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-pointer-width": "64",
"target-c-int-width": 32,
"os": "none",
"executables": true,