89 Commits

Author SHA1 Message Date
a766726065 CLEANUP - Remove test tests 2018-03-20 14:11:21 +01:00
6730c599d2 Chapter 5: Unit Testing - COMPLETE 2018-03-20 14:11:21 +01:00
6f463b17d3 Turn off debug functions when testing 2018-03-20 14:11:21 +01:00
6c30e282ef Add tests for pointer comparison 2018-03-20 14:11:21 +01:00
498a78cd9f Tougher tests, and test the tests. 2018-03-20 14:11:21 +01:00
2b8fa6047d Use for instead of while - just a bit of cleanup 2018-03-20 14:11:21 +01:00
126ed26b3d A lot of refactoring 2018-03-20 14:11:21 +01:00
52846ceeac I just discovered __attribute__((constructor))! 2018-03-20 14:11:21 +01:00
71bee24e51 Make stuff happen in the right order 2018-03-20 14:11:21 +01:00
dbd2017df7 A bit cleaner error string handling 2018-03-20 14:11:21 +01:00
81730fe96a Move ttest include file 2018-03-20 14:11:21 +01:00
b82405a4c4 Make BEFORE and AFTER definiton function-like 2018-03-20 14:11:21 +01:00
e29262e9aa Add AFTER() for cleanup 2018-03-20 14:11:21 +01:00
187d131ab0 Nicer test error output 2018-03-20 14:11:21 +01:00
512e1a988a Make test definitions more function like 2018-03-20 14:11:21 +01:00
826885df8a Make ttest compile under clang 2018-03-20 14:11:21 +01:00
ad74123882 Handle null pointers in string comparisons 2018-03-20 14:11:21 +01:00
cfa1a15076 Define TTEST when ttesting. Also allow multiple assertions per test 2018-03-20 14:11:21 +01:00
1b80c00658 Fix overflow bug when comparing strings 2018-03-20 14:11:21 +01:00
e50fbff2d1 Handle compilation errors of tests 2018-03-20 14:11:21 +01:00
96849d6600 Keep going if a test fails, but report it 2018-03-20 14:11:21 +01:00
cba19b62df More assertions and catching crashes 2018-03-20 14:11:21 +01:00
337d2cb032 Correct filenames in test error output 2018-03-20 14:11:21 +01:00
faaedb212d A simple testing framework 2018-03-20 14:11:21 +01:00
a908284dc6 Chapter 4: Higher Half Kernel - COMPLETE 2018-03-20 14:10:03 +01:00
823560d3ae Simplify P2V and V2P macros - also makes them more useful 2018-03-20 14:10:03 +01:00
8e47d7625f Don't set fs and gs. 2018-03-20 14:10:03 +01:00
950de8645c Update GDT pointer after unmapping GDT 2018-03-20 14:10:03 +01:00
b5e0d749b8 Reload cr3 after updating P4 2018-03-20 14:10:03 +01:00
83f81b9a74 Cleaning up and commenting 2018-03-20 14:10:03 +01:00
ab1a471857 Call a c function. 2018-03-20 14:10:03 +01:00
0a4b5ebd51 Update the stack pointer and remove identity mapping 2018-03-20 14:10:03 +01:00
663668ff93 Move the kernel to high memory 2018-03-20 14:10:03 +01:00
8f8e03de10 Chapter 3: Enter Long Mode - COMPLETE 2018-03-20 14:09:57 +01:00
646d25825a Don't use huge pages, for simplicity 2018-03-20 14:01:26 +01:00
99ecff44d8 Save one byte! 2018-03-19 20:29:40 +01:00
3122de1666 Remove cpuid and longmode checks. Let's assume we have a modern processor 2018-03-19 20:29:40 +01:00
3d380f462b Use 2 Mb translation instead of 1 Gb 2018-03-19 20:29:40 +01:00
78dc192a16 Don't load fs and gs. They have special meaning in long mode. 2018-03-19 20:29:40 +01:00
6511c39762 Gdb function for printing register values 2018-03-19 20:29:40 +01:00
bb25b7ea35 Change comment style, and more commenting 2018-03-19 20:29:40 +01:00
4f9a4292e5 Some simplification and commenting 2018-03-19 20:29:40 +01:00
93d60294ba Move include files 2018-03-19 20:29:40 +01:00
5ddf0173c2 Remove magic numbers. Also, no code segment - not needed. 2018-03-19 20:29:40 +01:00
dd7636e906 Simplest possible long-mode entry 2018-03-19 20:29:40 +01:00
eb637d0bbb Move stack to .bss and use it for function calls as well 2018-03-19 20:29:40 +01:00
dd565454e3 Check if long mode is available 2018-03-19 20:29:40 +01:00
a9328d6b67 Chapter 2: A Bootable Kernel - COMPLETE 2018-03-19 20:29:40 +01:00
607266bfd3 Clean up interface 2018-03-19 20:29:40 +01:00
eed3bb693b Commenting and cleanup 2018-03-19 20:29:40 +01:00