mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-21 16:37:48 +00:00
Compare commits
6 Commits
c4d8e55890
...
660390e4a7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
660390e4a7 | ||
|
|
54010c3653 | ||
|
|
b8be0c5a5d | ||
|
|
5c3adee95b | ||
|
|
fc8c87bee5 | ||
|
|
e1c58bba97 |
@@ -406,6 +406,8 @@ Instead of writing our own bootloader, which is a project on its own, we use the
|
|||||||
bootloader = "0.9"
|
bootloader = "0.9"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
**Note:** This post is only compatible with `bootloader v0.9`. Newer versions use a different build system and will result in build errors when following this post.
|
||||||
|
|
||||||
Adding the bootloader as a dependency is not enough to actually create a bootable disk image. The problem is that we need to link our kernel with the bootloader after compilation, but cargo has no support for [post-build scripts].
|
Adding the bootloader as a dependency is not enough to actually create a bootable disk image. The problem is that we need to link our kernel with the bootloader after compilation, but cargo has no support for [post-build scripts].
|
||||||
|
|
||||||
[post-build scripts]: https://github.com/rust-lang/cargo/issues/545
|
[post-build scripts]: https://github.com/rust-lang/cargo/issues/545
|
||||||
|
|||||||
BIN
scripts/cover.png
Normal file
BIN
scripts/cover.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
30
scripts/create-book.sh
Executable file
30
scripts/create-book.sh
Executable file
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# create working dir
|
||||||
|
rm -r book/
|
||||||
|
mkdir book/
|
||||||
|
|
||||||
|
# copy data to working dir
|
||||||
|
cat ../blog/content/edition-2/posts/*/index.md > book/book.md
|
||||||
|
find ../blog/content/edition-2/posts ! -name "*.md" -exec cp -t book/ {} +
|
||||||
|
|
||||||
|
# remove zola metadata
|
||||||
|
sed -i '/^+++/,/^+++/d' book/book.md
|
||||||
|
# remove br in table in 06, pandoc handles the layout
|
||||||
|
sed -i '/<br>/d' book/book.md
|
||||||
|
# details/summary breaks epub layout
|
||||||
|
sed -i '/^<details>/d' book/book.md
|
||||||
|
sed -i '/^<\/details>/d' book/book.md
|
||||||
|
sed -i '/^<summary>/d' book/book.md
|
||||||
|
|
||||||
|
# special fix for linking to different folder
|
||||||
|
sed -i 's|../paging-introduction/||g' book/book.md
|
||||||
|
|
||||||
|
# go to work dir and create epub
|
||||||
|
cd book/
|
||||||
|
pandoc book.md -o "Writing an OS in Rust.epub" --metadata cover-image="../cover.png" --metadata title="Writing an OS in Rust" --metadata author="Philipp Oppermann" --metadata description="This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code, so you can follow along if you like. The source code is also available in the corresponding Github repository."
|
||||||
|
|
||||||
|
#clean up
|
||||||
|
cd ..
|
||||||
|
mv "book/Writing an OS in Rust.epub" .
|
||||||
|
rm -rf book/
|
||||||
Reference in New Issue
Block a user