The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix templeOS article better

Signed-off-by: Xe Iaso <me@xeiaso.net>

Xe Iaso 4dbc0b46 a37eab38

+28 -28
+28 -28
lume/src/blog/templeos-1-installation-and-basic-use-2019-05-20.md
··· 12 12 13 13 This is not intended to make fun of the mentally ill, disabled or otherwise incapacitated. This is not an endorsement of any of Davis' political views. This is intended to glorify and preserve his life's work that so few can currently really grasp the scope of. 14 14 15 - If for some reason you are having issues downloading the TempleOS ISO, I have uploaded my copy of it [here](https://cdn.xeiaso.net/file/christine-static/blog/TOS_Distro.ISO). Here is its SHA512 sum: 15 + If for some reason you are having issues downloading the TempleOS ISO, I have uploaded my copy of it [here](https://cdn.xeiaso.net/file/christine-static/TOS_Distro.ISO). Here is its SHA512 sum: 16 16 17 17 ``` 18 18 7a382d802039c58fb14aab7940ee2e4efb57d132d0cff58878c38111d065a235562b27767de4382e222208285f3edab172f29dba76cb70c37f116d9521e54c45 TOS_Distro.ISO ··· 40 40 41 41 TempleOS is a 64 bit OS, so pick the type `Other` and the version `Other/Unknown (64-bit)`. Name your VM whatever you want: 42 42 43 - ![TempleOS VM setup first page](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_vm_1.png) 43 + ![TempleOS VM setup first page](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_vm_1.png) 44 44 45 45 Then press Continue. 46 46 47 47 [TempleOS requires 512 MB of ram to boot](https://github.com/Xe/TempleOS/blob/master/ReadMe.TXT#L11), so let's be safe and give it 2 gigs: 48 48 49 - ![TempleOS VM setup, 2048 MB of ram allocated](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_vm_2.png) 49 + ![TempleOS VM setup, 2048 MB of ram allocated](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_vm_2.png) 50 50 51 51 Then press Continue. 52 52 53 53 It will ask if you want to create a new hard disk. You do, so click Create: 54 54 55 - ![TempleOS VM setup, creating new hard disk](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_vm_3.png) 55 + ![TempleOS VM setup, creating new hard disk](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_vm_3.png) 56 56 57 57 We want a VirtualBox virtual hard drive, so click Continue: 58 58 59 - ![TempleOS VM setup, choosing hard disk format](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_vm_4.png) 59 + ![TempleOS VM setup, choosing hard disk format](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_vm_4.png) 60 60 61 61 Performance of the virtual hard disk is irrelevant for our usecases, so a dynamically expanding virtual hard disk is okay here. If you feel better choosing a fixed size allocation, that's okay too. Click Continue: 62 62 63 - ![TempleOS VM setup, choosing hard disk traits](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_vm_5.png) 63 + ![TempleOS VM setup, choosing hard disk traits](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_vm_5.png) 64 64 65 65 The ISO this OS comes from is 20 MB. So the default hard disk size of 2 GB is way more than enough. Click Continue: 66 66 67 - ![TempleOS VM setup, choosing hard disk size](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_vm_6.png) 67 + ![TempleOS VM setup, choosing hard disk size](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_vm_6.png) 68 68 69 69 Now the VM "hardware" is set up. 70 70 ··· 72 72 73 73 TempleOS actually includes an installer on the live CD. Power up your hardware and stick the CD into it, then click Start: 74 74 75 - ![TempleOS installation, adding live cd to virtual machine](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_install_1.png) 75 + ![TempleOS installation, adding live cd to virtual machine](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_install_1.png) 76 76 77 77 Within a few seconds, the VM compiles the compiler, kernel and userland and then dumps you to this screen, which should look conceptually familiar: 78 78 79 - ![TempleOS installation, immediately after boot](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_install_2.png) 79 + ![TempleOS installation, immediately after boot](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_install_2.png) 80 80 81 81 We would like to install on the hard drive, so press `y`: 82 82 83 - ![TempleOS installation, pressing y](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_install_3.png) 83 + ![TempleOS installation, pressing y](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_install_3.png) 84 84 85 85 We're using VirtualBox, so press `y` again (if you aren't, be prepared to enter the IRQ's of your hard drive/s and CD drive/s): 86 86 87 - ![TempleOS installation, pressing y again](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_install_4.png) 87 + ![TempleOS installation, pressing y again](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_install_4.png) 88 88 89 89 Press any key and wait for the freeze to happen. 90 90 91 91 The installer will take over from here, copying the source code of the OS, Compiler and userland as well as compiling a bootstrap kernel: 92 92 93 - ![TempleOS installation, self-piloted](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_install_5.png) 93 + ![TempleOS installation, self-piloted](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_install_5.png) 94 94 95 95 After a few seconds, it will ask you if you want to reboot. You do, so press `y` one final time: 96 96 97 - ![TempleOS installation, about to reboot into TempleOS](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_install_6.png) 97 + ![TempleOS installation, about to reboot into TempleOS](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_install_6.png) 98 98 99 99 Make sure to remove the TempleOS live CD from your hardware or it will be booted instead of the new OS. 100 100 ··· 102 102 103 103 The [TempleOS Bootloader](https://github.com/Xe/TempleOS/blob/1dd8859b7803355f41d75222d01ed42d5dda057f/Adam/Opt/Boot/BootMHDIns.HC#L69) presents a helpful menu to let you choose if you want to boot from a copy of the old boot record (preserved at install time), drive C or drive D. Press 1: 104 104 105 - ![TempleOS boot, picking the partition](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_boot_1.png) 105 + ![TempleOS boot, picking the partition](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_boot_1.png) 106 106 107 107 The first boot requires the dictionary to be uncompressed as well as other housekeeping chores, so let it do its thing: 108 108 109 - ![TempleOS boot, chores](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_boot_2.png) 109 + ![TempleOS boot, chores](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_boot_2.png) 110 110 111 111 Once it is done, you will see if the option to take the tour. I highly suggest going through this tour, but that is beyond the scope of this article, so we'll assume you pressed `n`: 112 112 113 - ![TempleOS boot, denying the tour](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_boot_3.png) 113 + ![TempleOS boot, denying the tour](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_boot_3.png) 114 114 115 115 ### Using the Compiler 116 116 117 - ![TempleOS boot, HolyC prompt](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_boot_4.png) 117 + ![TempleOS boot, HolyC prompt](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_boot_4.png) 118 118 119 119 The "shell" is itself an interface to the HolyC (similar to C) compiler. There is no difference between a "shell" REPL and a HolyC repl. This is stupidly powerful: 120 120 121 - ![TempleOS hello world](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_1.png) 121 + ![TempleOS hello world](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_1.png) 122 122 123 123 ``` 124 124 "Hello, world\n"; ··· 128 128 129 129 Open a new file with `Ed("HelloWorld.HC");` (the semicolon is important): 130 130 131 - ![TempleOS opening a file](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_2.png) 131 + ![TempleOS opening a file](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_2.png) 132 132 133 - ![TempleOS editor screen](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_3.png) 133 + ![TempleOS editor screen](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_3.png) 134 134 135 135 Now press Alt-Shift-a to kill autocomplete: 136 136 137 - ![TempleOS sans autocomplete](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_4.png) 137 + ![TempleOS sans autocomplete](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_4.png) 138 138 139 139 Click the `X` in the upper right-hand corner to close the other shell window: 140 140 141 - ![TempleOS sans other window](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_5.png) 141 + ![TempleOS sans other window](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_5.png) 142 142 143 143 Finally press drag the right side of the window to maximize the editor pane: 144 144 145 - ![TempleOS full screen editor](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_6.png) 145 + ![TempleOS full screen editor](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_6.png) 146 146 147 147 Let's put the hello word example into the program and press `F5` to run it: 148 148 149 - ![TempleOS hello world in a file](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_7.png) 149 + ![TempleOS hello world in a file](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_7.png) 150 150 151 151 Neat! Close that shell window that just popped up. Let's put this hello world code into a function: 152 152 ··· 160 160 161 161 Now press `F5` again: 162 162 163 - ![TempleOS hello world from a function](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_8.png) 163 + ![TempleOS hello world from a function](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_8.png) 164 164 165 165 Let's disassemble it: 166 166 ··· 172 172 Uf("HelloWorld"); 173 173 ``` 174 174 175 - ![TempleOS hello world disassembled](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_9.png) 175 + ![TempleOS hello world disassembled](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_9.png) 176 176 177 177 The `Uf` function also works with anything else, including things like the editor: 178 178 ··· 180 180 Uf("Ed"); 181 181 ``` 182 182 183 - ![TempleOS editor disassembled](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_10.png) 183 + ![TempleOS editor disassembled](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_10.png) 184 184 185 185 All of the red underscored things that look like links actually are links to the source code of functions. While the HolyC compiler builds things, it internally keeps a sourcemap (much like webapp sourcemaps or how gcc relates errors at runtime to lines of code for the developer) of all of the functions it compiles. Let's look at the definition of `Free()`: 186 186 187 - ![TempleOS Free() function](https://cdn.xeiaso.net/file/christine-static/static/blog/img/tos/tos_compiler_11.png) 187 + ![TempleOS Free() function](https://cdn.xeiaso.net/file/christine-static/static/img/tos/tos_compiler_11.png) 188 188 189 189 And from here you can dig deeper into the kernel source code. 190 190