thomas
|
49f7738be2
|
Parse multiboot information
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
d0b946f327
|
Chapter 6: Debug Output - COMPLETE
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
9e2483d78e
|
Halt-And-Catch-Fire macro
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
2da088f031
|
Clean up interface
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
e6d046d593
|
A bit of cleanup in vga functions
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
15bbfd6e6a
|
A real memmove function
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
042f61bdb3
|
Add padding to field width (right adjust)
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
0f5445da62
|
Script for viewing the serial log in glorious technicolor
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
0659cf73f6
|
Some more debug macros
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
572bee19cc
|
Add ability to disable debug printing and gdb symbols
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
a9831c1038
|
A macro for debug printing
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
a652bbb05e
|
Remove magic numbers
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
b50b32afa9
|
Move VGA cursor when writing to screen
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
055c41adb3
|
Scrolling screen when necessary
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
4f00d428bf
|
Writing (debug output) to screen
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
b9e9df32f5
|
Tests for memory copy and write functions
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
954696728c
|
Add memory copy and move functions. Required by gcc, and we'll also use
them soon
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
c19bc51bdc
|
Output serial to a file
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
034a870ac7
|
Sending data (debug printing) to serial port
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
d05ddfeab4
|
Debug printing functions
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
a766726065
|
CLEANUP - Remove test tests
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
6730c599d2
|
Chapter 5: Unit Testing - COMPLETE
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
6f463b17d3
|
Turn off debug functions when testing
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
6c30e282ef
|
Add tests for pointer comparison
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
498a78cd9f
|
Tougher tests, and test the tests.
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
2b8fa6047d
|
Use for instead of while - just a bit of cleanup
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
126ed26b3d
|
A lot of refactoring
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
52846ceeac
|
I just discovered __attribute__((constructor))!
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
71bee24e51
|
Make stuff happen in the right order
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
dbd2017df7
|
A bit cleaner error string handling
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
81730fe96a
|
Move ttest include file
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
b82405a4c4
|
Make BEFORE and AFTER definiton function-like
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
e29262e9aa
|
Add AFTER() for cleanup
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
187d131ab0
|
Nicer test error output
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
512e1a988a
|
Make test definitions more function like
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
826885df8a
|
Make ttest compile under clang
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
ad74123882
|
Handle null pointers in string comparisons
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
cfa1a15076
|
Define TTEST when ttesting. Also allow multiple assertions per test
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
1b80c00658
|
Fix overflow bug when comparing strings
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
e50fbff2d1
|
Handle compilation errors of tests
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
96849d6600
|
Keep going if a test fails, but report it
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
cba19b62df
|
More assertions and catching crashes
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
337d2cb032
|
Correct filenames in test error output
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
faaedb212d
|
A simple testing framework
|
2018-03-20 14:11:21 +01:00 |
|
thomas
|
a908284dc6
|
Chapter 4: Higher Half Kernel - COMPLETE
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
823560d3ae
|
Simplify P2V and V2P macros - also makes them more useful
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
8e47d7625f
|
Don't set fs and gs.
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
950de8645c
|
Update GDT pointer after unmapping GDT
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
b5e0d749b8
|
Reload cr3 after updating P4
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
83f81b9a74
|
Cleaning up and commenting
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
ab1a471857
|
Call a c function.
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
0a4b5ebd51
|
Update the stack pointer and remove identity mapping
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
663668ff93
|
Move the kernel to high memory
|
2018-03-20 14:10:03 +01:00 |
|
thomas
|
8f8e03de10
|
Chapter 3: Enter Long Mode - COMPLETE
|
2018-03-20 14:09:57 +01:00 |
|
thomas
|
646d25825a
|
Don't use huge pages, for simplicity
|
2018-03-20 14:01:26 +01:00 |
|
thomas
|
99ecff44d8
|
Save one byte!
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
3122de1666
|
Remove cpuid and longmode checks. Let's assume we have a modern processor
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
3d380f462b
|
Use 2 Mb translation instead of 1 Gb
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
78dc192a16
|
Don't load fs and gs. They have special meaning in long mode.
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
6511c39762
|
Gdb function for printing register values
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
bb25b7ea35
|
Change comment style, and more commenting
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
4f9a4292e5
|
Some simplification and commenting
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
93d60294ba
|
Move include files
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
5ddf0173c2
|
Remove magic numbers. Also, no code segment - not needed.
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
dd7636e906
|
Simplest possible long-mode entry
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
eb637d0bbb
|
Move stack to .bss and use it for function calls as well
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
dd565454e3
|
Check if long mode is available
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
a9328d6b67
|
Chapter 2: A Bootable Kernel - COMPLETE
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
607266bfd3
|
Clean up interface
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
eed3bb693b
|
Commenting and cleanup
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
2451851b9f
|
Remove Multiboot1 support
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
05efb98b06
|
Use classic variables for installing kernel
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
bc8f16e270
|
Also simplify the kernel code as much as possible.
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
e2ecdb6154
|
Keep the multiboot header as simple as possible
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
ca36e0ad0e
|
Indicate multiboot version on boot
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
a44d0d7500
|
Move Multiboot headers to separate file
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
f5fb6241f2
|
Simplify linker script
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
e016c5dc52
|
Cleaning up the kernel makefile
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
d7560b775c
|
Remove hardcoded buildroot from kernel makefile and gdbinit
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
0f8d38938b
|
Make git ignore stuff that isn't source files
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
a0f3953365
|
Make debugging work
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
de73851481
|
Dependency file generation - rebuild if a header file is updated
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
dda15ea889
|
Save eax after boot, so we can check that we're actually loaded via
multiboot
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
d80e87991e
|
A bit of cleanup
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
fef9a11d16
|
Use either multiboot1 or multiboot2
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
14cd812e34
|
Add grub menu item to boot automatically
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
a8fbcd9e03
|
Top level makefile. Also make clean
|
2018-03-19 20:29:40 +01:00 |
|
thomas
|
39b43d825a
|
Building a multiboot 1 compatible executable
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
0df19ec2b7
|
Chapter 1: Toolchain - COMPLETE
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
bbd88e8567
|
Some commenting and cleanup
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
64af272ef1
|
Include host compiler and valgrind in docker image
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
2b1d17d944
|
Run docker as user, not root
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
aee015eebc
|
Use new version of qemu to avoid problems when changing to long mode
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
a44876fd2e
|
Update binutils and gcc version
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
d339e27080
|
Compile binutils and gcc from scratch
Turns out the alpine versione doesn't quite work well with low-level 32
bit code...
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
261cc76e8f
|
Don't hardcode paths
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
177be9dcc5
|
Rename debug script to gdb so that it overloads the gdb command
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
9a3281ff56
|
Use silent docker commands for cleaner scripting
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
851f4cb7f3
|
Describe the setup in the README file.
Most of this should probably move to a documentation folder...
|
2018-03-19 20:29:39 +01:00 |
|
thomas
|
6f61f380ee
|
Compress environment checking
|
2018-03-19 20:29:39 +01:00 |
|