This commit is contained in:
Miloslav Ciz 2025-04-08 21:14:43 +02:00
parent 362a9efe1f
commit 8ac0ebb55b
10 changed files with 2041 additions and 2014 deletions

20
cpu.md
View file

@ -2,29 +2,29 @@
WORK IN PROGRESS
Central processing unit (CPU, often just *processor*) is the main central part of a [computer](computer.md), one that carries out computation by following instructions of the main [program](program.md), therefore it's colloquially likened to the computer's "brain". CPU stands at the center of computer design because other parts (such as the main [memory](ram.md), [hard disk](hdd.md) and [input/output](io.md) devices like keyboard and monitor) are present to serve the CPU, their master. CPU is normally composed of [ALU](alu.md) (arithmetic logic unit, the circuit performing calculations), CU ([control unit](control_unit.md), the circuit that directs the CPU's operation), a relatively small amount of memory (e.g. its registers, temporary buffers and [cache](cache.md), the main [RAM](ram.md) memory is NOT part of a CPU!) and possibly also other parts. A specific model of CPU is characterized by its [instruction set](isa.md) (ISA, e.g. [x86](x86.md) or [Arm](arm.md), which we mostly divide into [CISC](cisc.md) and [RISC](risc.md)) which subsequently determines the [machine code](machine_code.md) it will understand, then by its [transistor](transistor.md) count (nowadays billions), operation [frequency](frequency.md) or **clock rate** (defining how many instructions per second it executes, nowadays typically billions; the frequency can also be increased with [overclocking](overclocking.md)), number of cores (determining how many programs it can run in parallel) and also other parameters and "features" such as amount of [cache](cache.md) memory, possible operation modes etcetc. Very commonly we also associate a CPU with a **number of [bits](bit.md)** (called *[word](word.md) size* or something similar) that's often connected to the data [bus](bus.md) width and the CPU's native integer size, i.e. for example a 16 bit CPU will likely consist of 16 bit integer registers, it will see the memory as a sequence of 16 bit words, its memory addresses may be limited to 16 bits etc. (note that the CPU can still handle even wider words by emulating them with the native words, but this will suffer performance penalties) -- nowadays most mainstream CPUs are 64 bit (to allow ungodly amounts of RAM), but 32 or even 16 and 8 bits is usually enough for [good programs](lrs.md). CPU in form of a single small integrated circuit is called *microprocessor*. CPU is not to be [confused](often_confused.md) with [MCU](mcu.md), a small single board computer which is composed of a CPU and other parts.
Central processing unit (CPU, often just *processor*) is the main, central part of a [computer](computer.md), one that carries out computation by following instructions of the main [program](program.md), colloquially likened to the computer's "brain". CPU stands at the center of computer design because other parts (such as the main [memory](ram.md), [hard disk](hdd.md) and [input/output](io.md) devices like keyboard and monitor) are present to serve the CPU, their master. CPU is normally composed of [ALU](alu.md) (arithmetic logic unit, the circuit performing calculations), CU ([control unit](control_unit.md), the circuit that directs the CPU's operation), a relatively small amount of memory (e.g. its registers, temporary buffers and [cache](cache.md), the main [RAM](ram.md) memory is NOT part of a CPU!) and possibly also other components. A specific model of CPU is characterized by its [instruction set](isa.md) (ISA, e.g. [x86](x86.md) or [Arm](arm.md), which we mostly divide into [CISC](cisc.md) and [RISC](risc.md)) which subsequently determines the [machine code](machine_code.md) it will understand, then by its [transistor](transistor.md) count (nowadays billions), operation [frequency](frequency.md) or **clock rate** (defining how many instructions per second it executes, nowadays typically billions; the frequency can also be increased with [overclocking](overclocking.md)), number of cores (determining how many programs it can run in parallel) and also other parameters and "features" such as amount of [cache](cache.md) memory, possible operation modes etcetc. Very commonly we also associate a CPU with a **number of [bits](bit.md)** (called *[word](word.md) size* or something similar) that's often connected to the data [bus](bus.md) width and the CPU's native integer size, i.e. for example a 16 bit CPU will likely consist of 16 bit integer registers, it will see the memory as a sequence of 16 bit words, its memory addresses may be limited to 16 bits etc. (note that the CPU can still handle even wider words by emulating them with the native words, but this will suffer performance penalties) -- nowadays most mainstream CPUs are 64 bit (to allow ungodly amounts of RAM), but 32 or even 16 and 8 bits is usually enough for [good programs](lrs.md). CPU in form of a single small integrated circuit is called *microprocessor*. CPU is not to be [confused](often_confused.md) with [MCU](mcu.md), a small single board computer which is composed of a CPU and other parts.
CPU is meant to perform **general purpose computation**, i.e. it can execute anything reasonably fast but won't reach near optimum speed at certain specialized tasks (e.g. processing HD video or [rendering 3D graphics](3d_rendering.md)), which is why other specialized processing units such as [GPU](gpu.md)s (graphics processing unit) and sound cards exist. Because CPU is a general [algorithm](algorithm.md) executing unit, it is made for running **linear** programs, i.e. a series of instructions that go one after another; even though today CPUs more often than not sport multiple cores and therefore the ability to run several linear programs in parallel, their level of parallelism is still low, not nearly in the same league as a GPU for example. CPUs are nonetheless [good enough](good_enough.md) for most tasks and nowadays reach astronomical speeds anyway, so a [suckless](suckless.md)/[LRS](lrs.md) program will likely choose to only rely on CPU, knowing it's safe to assume presence of this most essential part of a computer, and by that our program becomes more [portable](portability.md) and [future proof](future_proof.md).
CPU is meant to perform **general purpose computation**, i.e. it can execute anything reasonably fast but won't reach near optimum speed at certain specialized tasks (e.g. processing HD video or [rendering 3D graphics](3d_rendering.md)), which is why other specialized processing units such as [GPUs](gpu.md) (graphics processing unit) and sound cards exist. Because CPU is a general [algorithm](algorithm.md) executing unit, it is made for running **linear** programs, i.e. a series of instructions that go one after another; even though today CPUs more often than not sport multiple cores and with it the capability of running several linear programs in parallel, their level of parallelism is still low, not nearly in the same league as a GPU for example. CPUs are nonetheless [good enough](good_enough.md) for most tasks and nowadays reach astronomical speeds anyway, so a [suckless](suckless.md)/[LRS](lrs.md) program will likely choose to only rely on CPU, knowing it's safe to assume presence of this most essential part of a computer, and by that our program becomes more [portable](portability.md) and [future proof](future_proof.md).
Designs of CPUs differ, some may aim to maximize performance while others prefer lower power consumption or low transistor count -- remember, a more complex CPU is more expensive because it requires more [transistors](transistor.md)! Of course it will also be harder to design, [debug](debugging.md) etc., so it may be better to [keep it simple](kiss.md) when designing a CPU. For this reason many CPUs, e.g. those in [embedded](embedded.md) [microcontrollers](mcu.md), intentionally lack cache, [microcode](microcode.md), multiple cores or even a complex instruction pipeline. Space technology for instance highly prefers reliability before performance.
**WATCH OUT**: [modern](modern.md) mainstream CPUs (i.e. basically the ones in desktops and spyphones) are [shit](shit.md), they are hugely [consumerist](consumerism.md), [bloated](bloat.md) (they literally include shit like [GPU](gpu.md)s and whole [operating systems](os.md), e.g. Intel's [ME](me.md) runs [Minix](minix.md)) and have built-in antifeatures such as [backdoor](backdoor.md)s (post 2010 basically all Intel and AMD CPUs, see Intel [Management Engine](me.md) and AMD [PSP](psp.md)) that can't be disabled and that allow remote infiltration of your computer by the CPU manufacturer (on hardware level, no matter what operating system you run). You are much better off using a simple CPU if you can ([older](old.md), [embedded](embedded.md) etc.).
**WATCH OUT**: [modern](modern.md) [mainstream](mainstream.md) CPUs (practically the ones in desktops and spyphones) are [shit](shit.md), they are hugely [consumerist](consumerism.md), [bloated](bloat.md) (they literally include shit like [GPU](gpu.md)s and whole [operating systems](os.md), e.g. Intel's [ME](me.md) runs [Minix](minix.md)) and have built-in antifeatures such as [backdoor](backdoor.md)s (post 2010 basically all Intel and AMD CPUs, see Intel [Management Engine](me.md) and AMD [PSP](psp.md)) that can't be disabled and that allow remote infiltration of your computer by the CPU manufacturer (on hardware level, no matter what operating system you run). You are much better off using a simple CPU if you can ([older](old.md), [embedded](embedded.md) etc.).
## Details
TODO: diagrams, modes, transistor count history ...
Let's take a look at how our average CPU operates. Indeed the techno world is diverse and so we mustn't forget nothing's set in [stone](rock.md), CPUs differ in many ways. We may also simplify some concepts a bit, real world CPUs are complicated as hell.
Let's take a look at how our average CPU operates. Indeed the techno world is diverse and so we mustn't assume that anything is set in [stone](rock.md), CPUs vary in many ways. We may also dumb down some concepts a bit, real world CPUs are remarkably overengineered and complicated as hell.
Firstly then the most pressing question: **what is it that a CPU really does?** Basically it just reads instructions from the memory (depending on specific computer architecture this may be [RAM](ram.md) or [ROM](rom.md)) and does what they say -- these instructions are super simple, often commands like "add two numbers", "write a number to memory" and so on. The instructions themselves are just [binary](binary.md) data in memory and their format depends on each CPU, or more precisely its **[instruction set](isa.md)** (basically a very low level language it understands) -- each CPU, or rather a CPU family, may generally have a different instruction set, so a program in one instruction set can't be executed by a CPU that doesn't understand this instruction set. The whole binary program for the CPU is called **[machine code](machine_code.md)** and machine code corresponds to **[assembly](assembly.md) language** (basically a textual representation of the machine code, for better readability by humans) of the CPU (or better said its instruction set). So a CPU can be seen as a hardware [interpreter](interpreter.md) of specific machine code, machine code depends on the instruction set and programmer can create machine code by writing a program in assembly language (which is different for each instruction set) and then using an assembler to translate the program to machine code. Nowadays mostly two instruction sets are used: [x86](x86.md) and [Arm](arm.md), but there are also other ones, AND it's still not so simple because each instruction set gets some kind of updates and/or has some extensions that may or may not be supported by a specific CPU, so it's a bit messy. For example [IA-32](ia_32.md) and [x86_64](x86_64.md) are two different versions of the x86 ISA, one 32 bit and one 64 bit.
Firstly then the most pressing question: **what is it that a CPU really does?** In essence it just reads instructions from the memory (depending on specific computer architecture this may be [RAM](ram.md) or [ROM](rom.md)) and does whatever they dictate -- these instructions are super simple, often commands like "add two numbers", "write a number to memory" and so on. The instructions themselves are nothing more than [binary](binary.md) data in memory and their format depends on each CPU, or more precisely its **[instruction set](isa.md)** (basically a very low level language it understands) -- each CPU, or rather a CPU family, may generally have a different instruction set, so a program in one instruction set can't be executed by a CPU that doesn't understand this instruction set. The whole binary program for the CPU is called **[machine code](machine_code.md)** and machine code corresponds to **[assembly](assembly.md) language** (basically a textual representation of the machine code, for better readability by humans) of the CPU (or better said its instruction set). So a CPU can be seen as a hardware [interpreter](interpreter.md) of specific machine code, machine code depends on the instruction set and programmer can create machine code by writing a program in assembly language (which is different for each instruction set) and then using an assembler to translate the program to machine code. Nowadays mostly two instruction sets are used: [x86](x86.md) and [Arm](arm.md), but there are also other ones, AND it's still not so simple because each instruction set gets some kind of updates and/or has some extensions that may or may not be supported by a specific CPU, so it's a bit messy. For example [IA-32](ia_32.md) and [x86_64](x86_64.md) are two different versions of the x86 ISA, one 32 bit and one 64 bit.
The CPU has some internal state (we can see it as a [state machine](finite_state_machine.md)), i.e. it has a few internal variables, called **[registers](register.md)**; these are NOT variables in RAM but rather in the CPU itself, there is only a few of them (there may be let's say 32) but they are extremely fast. What exactly these registers are, what they are called, how many [bits](bit.md) they can hold and what their purpose is depends again on the instruction set architecture. However there are usually a few special registers, notably the **program counter** which holds the address of the currently executed instruction. After executing an instruction program counter is incremented so that in the nest step the next instruction will be executed, AND we can also modify program counter (sometimes directly, sometimes by specialized instructions) to jump between instruction to implement branching, loops, function calls etc.
The CPU has an internal state (we can picture it as a [state machine](finite_state_machine.md)), i.e. it has a few internal variables, called **[registers](register.md)**; these are NOT variables in RAM but rather in the CPU itself, there is only a few of them (let's say 32 for example) but they are stunningly fast, much faster than any other memory. What exactly these registers are, what they are called, how many [bits](bit.md) they can hold and what their purpose is depends again on the instruction set architecture. However there are usually a few special registers, notably the **program counter** which holds the address of the currently executed instruction. After executing an instruction program counter is incremented so that in the nest step the next instruction will be executed, AND we can also modify program counter (sometimes directly, sometimes by specialized instructions) to jump between instruction to implement branching, loops, function calls etc.
So at the beginning (when powered on) the CPU is set to some initial state, most notably it sets its program counter to some initial value (depending on each CPU, it may be e.g. 0) so that it points to the first instruction of the program. Then it performs so called **fetch, decode, execute** cycle, i.e. it reads the instruction, decodes what it means and does what it says. In simpler CPUs this functionality is hard wired, however more complex CPUs (especially [CISC](cisc.md)) are programmed in so called [microcode](microcode.md), a code yet at the lower level than machine code, machine code execution is programmed in microcode -- microcode is something like "[firmware](firmware.md) for the CPU" (or a "CPU [shader](shader.md)"?), it basically allows later updates and reprogramming of how the CPU internally works. However this is pretty [overcomplicated](bloat.md) and you shouldn't make CPUs like this.
So at the beginning (when powered on) the CPU is set to some initial state, most notably it sets its program counter to some initial value (depending on each CPU, it may be e.g. 0) so that it points to the first instruction of the program. Then it performs so called **fetch, decode, execute** cycle, i.e. it reads the instruction, decodes what it means and does what it says. In simpler CPUs this functionality is hard wired, however more complex CPUs (especially [CISC](cisc.md)) are programmed in so called [microcode](microcode.md), a code yet at the lower level than machine code, machine code execution is programmed in microcode -- microcode is something like "[firmware](firmware.md) for the CPU" (or a "CPU [shader](shader.md)"?), it basically allows later updates and reprogramming of how the CPU internally works. However this is pretty [overcomplicated](bloat.md) and you shouldn't make crappy CPUs like this.
A CPU works in **clock cycles**, i.e. it is a sequential circuit which has so called *clock* input; on this input voltage periodically switches between high and low (1 and 0) and each change makes the CPU perform another operation cycle. How fast the clock changes is determined by the clock **frequency** (nowadays usually around 3 GHz) -- the faster the frequency, the faster the CPU will compute, but the more it will also heat up (so we can't just set it up arbitrarily high, but we can [overclock](overclocking.md) it a bit if we are cooling it down). WATCH OUT: **one clock cycle doesn't necessarily equal one executed instruction**, i.e. frequency of 1 Hz doesn't have to mean the CPU will execute 1 instruction per second because executing an instruction may take several cycles (how many depends on each instruction and also other factors). The number saying how many cycles an instruction takes is called CPI (cycles per instruction) -- CPUs try to aim for CPI 1, i.e. they try to execute 1 instruction per cycle, but they can't always do it.
One way to try to achieve CPI 1 is by optimizing the *fetch, decode, execute* cycle in hardware so that it's performed as fast as possible. This is typically done by utilizing an instruction **[pipeline](pipeline.md)** -- a pipeline has several stages that work in parallel so that when one instruction is entering e.g. the *decode* stage, another one is already entering the *fetch* stage (and the previous instruction is in *execute* stage), i.e. we don't have to wait for an instruction to be fully processed before starting to process the next one. This is practically the same principle as that of manufacturing lines in factories; if you have a long car manufacturing pipeline, you can make a factory produce let's say one car each hour, though it is impossible to make a single car from scratch in one hour (or imagine e.g. a university producing new PhDs each year despite no one being able to actually earn PhD in a year). This is also why branching (jumps between instructions) are considered bad for program performance -- a jump to different instruction makes the CPU have to throw away its currently preprocessed instruction because that will not be executed (though CPUs again try to deal with this with so called *branch prediction*, but it can't work 100%). Some CPUs even have multiple pipelines, allowing for execution of multiple instructions at the same time -- however this can only be done sometimes (the latter instruction must be independent of the former, also the other pipelines may be simpler and able to only handle simple instructions).
One way to approach CPI 1 is by optimizing the *fetch, decode, execute* cycle in hardware so that it's as BLAZINGLY fast as possible. This is typically done by utilizing an instruction **[pipeline](pipeline.md)** -- a pipeline has several stages working in parallel so that as soon as one instruction is entering e.g. the *decode* stage, another one is already coming to the *fetch* stage (and the previous instruction is in *execute* stage), i.e. we don't have to wait for an instruction to be fully processed before starting to process the next one. This is practically the same principle as that of manufacturing lines in factories; if you have a long car manufacturing pipeline, you can make a factory produce let's say one car each hour, though it is impossible to make a single car from scratch in one hour (or imagine e.g. a university producing new PhDs each year despite no one being able to actually earn PhD in a year). This is also why branching (jumps between instructions) are considered bad for program performance -- a jump to different instruction makes the CPU have to throw away its currently preprocessed instruction because that will not be executed (though CPUs again try to deal with this with so called *branch prediction*, but it can't work 100%). Some CPUs even have multiple pipelines, allowing for execution of multiple instructions at the same time -- however this can only be done sometimes (the latter instruction must be independent of the former, also the other pipelines may be simpler and able to only handle simple instructions).
In order for a CPU to be useful it has to be able to perform some **[input/output](io.md)**, i.e. it has to be able to retrieve data from the outside and present what it has computed. Notable ways of performing I/O are:
@ -34,9 +34,9 @@ In order for a CPU to be useful it has to be able to perform some **[input/outpu
CPUs often also have a **[cache](cache.md)** memory that speeds up communication with the main memory (RAM, ROM, ...), though simpler CPUs may live even without cache of course. Mainstream CPUs even have several levels of cache, called L1, L2 etc. Caches are basically transparent for the programmer, they don't have to deal with them, it's just something that makes memory access faster, however a programmer knowing how a cache works can write code so as to be friendlier to the cache and utilize it better.
Mainstream consoomer CPUs nowadays have multiple **[cores](core.md)** so that each core can basically run a separate computation in parallel. The separate cores can be seen kind of like duplicate copies of the single core CPU with some connections between them (details again depend on each model), for example cores may share the cache memory, they will be able to communicate with each other etc. Of course this doesn't just magically make the whole CPU faster, it can now only run multiple computations at once, but someone has to make programs so as to make use of this -- typical use cases are e.g. [multitasking](multitasking.md) operating systems which can run different programs (or rather processes) on each core (note that multitasking can be done even with a single core by rapidly switching between the processes, but that's slower), or [multithreading](multithreading.md) programming languages which may run each thread on a separate core.
Mainstream consoomer CPUs nowadays have multiple **[cores](core.md)** so that each core can essentially run a separate computation in parallel. The separate cores can be seen kind of like duplicate copies of the single core CPU with some connections between them (details again depend on each model), for example cores may share the cache memory, they will be able to communicate with each other etc. Of course this doesn't just magically make the whole CPU faster, it can now only run multiple computations at once, but someone has to make programs so as to make use of this -- typical use cases are e.g. [multitasking](multitasking.md) operating systems which can run different programs (or rather processes) on each core (note that multitasking can be done even with a single core by rapidly switching between the processes, but that's slower), or [multithreading](multithreading.md) programming languages which may run each thread on a separate core.
**[Interrupts](interrupt.md)** are an important concept for the CPU and for low level programming, they play a role e.g. in saving power -- high level programmers often don't know what interrupts are, to those interrupts can be likened to "event [callbacks](callback.md)". An interrupt happens on some kind of even, for example when a key is pressed, when timer ticks, when error occurred etc. (An interrupt can also be raised by the CPU itself, this is how operating system [syscalls](syscall.md) are often implemented). What kinds of interrupts there are depends on each CPU architecture (consult your datasheet) and one can usually configure which interrupts to enable and which "callbacks" to use for them -- this is often done through so called **[vector](vector.md) table**, a special area in memory that records addresses ("vectors") of routines (functions/subprograms) to be called on specified interrupts. When interrupt happens, the current program execution is paused and the CPU automatically jumps to the subroutine for handling the interrupt -- after returning from the subroutine the main program execution continues. Interrupts are contrasted with **[polling](polling.md)**, i.e. manually checking some state and handling things as part of the main program, e.g. executing an infinite loop in which we repeatedly check keyboard state until some key is pressed. However polling is inefficient, it wastes power by constantly performing computation just by waiting -- interrupts on the other hand are a hard wired functionality that just performs a task when it happens without any overhead of polling. Furthermore interrupts can make programming easier (you save many condition checks and memory reads) and mainly **interrupts allow CPU to go into sleep mode** and so save a lot of power. When a CPU doesn't have any computation to do, it can stop itself and go into waiting state, not executing any instructions -- however interrupts still work and when something happens, the CPU jumps back in to work. This is typically what the `sleep`/`wait` function in your programming language does -- it puts the CPU to sleep and sets a timer interrupt to wake up after given amount of time. As a programmer you should know that you should call this sleep/wait function in your main program loop to relieve the CPU -- if you don't, you will notice the **CPU utilization** (amount of time it is performing computations) will go to 100%, it will heat up, your computer starts spinning the fans and be noisy because you don't let it rest.
**[Interrupts](interrupt.md)** are an important concept for the CPU and for low level programming, they play a role e.g. in saving power -- high level programmers often don't know what interrupts are, to those interrupts can be likened to "event [callbacks](callback.md)". An interrupt occurs on some sort of event, for example upon a key press, when timer ticks, when error occurred etc. (An interrupt can also be raised by the CPU itself, this is how operating system [syscalls](syscall.md) are often implemented). What kinds of interrupts there are depends on each CPU architecture (consult your datasheet) and one can usually configure which interrupts to enable and which "callbacks" to use for them -- this is often done through so called **[vector](vector.md) table**, a special area in memory that records addresses ("vectors") of routines (functions/subprograms) to be called on specified interrupts. When interrupt happens, the current program execution is paused and the CPU automatically jumps to the subroutine for handling the interrupt -- after returning from the subroutine the main program execution continues. Interrupts are contrasted with **[polling](polling.md)**, i.e. manually checking some state and handling things as part of the main program, e.g. executing an infinite loop in which we repeatedly check keyboard state until some key is pressed. However polling is inefficient, it wastes power by constantly performing computation just by waiting -- interrupts on the other hand are a hard wired functionality that just performs a task when it happens without any overhead of polling. Furthermore interrupts can make programming easier (you save many condition checks and memory reads) and mainly **interrupts allow CPU to go into sleep mode** and so save a lot of power. When a CPU doesn't have any computation to do, it can stop itself and go into waiting state, not executing any instructions -- however interrupts still work and when something happens, the CPU jumps back in to work. This is typically what the `sleep`/`wait` function in your programming language does -- it puts the CPU to sleep and sets a timer interrupt to wake up after given amount of time. As a programmer you should know that you should call this sleep/wait function in your main program loop to relieve the CPU -- if you don't, you will notice the **CPU utilization** (amount of time it is performing computations) will go to 100%, it will heat up, your computer starts spinning the fans and be noisy because you don't let it rest.
Frequently there are several **modes** of operation in a CPU which is typically meant for [operating systems](os.md) -- there will usually be some kind of privileged mode in which the CPU can do whatever it wants (this is the mode for the OS kernel) and a restricted mode in which there are "restrictions", e.g. on which areas of memory can be accessed or which instructions can be used (this will be used for user program). Thanks to this a user program won't be able to crash the operating system, it will at worst crash itself. Most notably x86 CPUs have the *real mode* (addresses correspond to real, physical addresses) and *protected mode* (memory is [virtualized](virtual_memory.md), protected, addresses don't generally correspond to physical addresses).

View file

@ -60,6 +60,8 @@ Doom also has a [deterministic](determinism.md) [FPS](fps.md)-independent physic
There is no [antialiasing](antialiasing.md) in the engine, i.e. aliasing can be noticed on far-away textures, but it is suppressed by the use of low-res textures and dimming far-away areas. There is also no edge smoothing (kind of misleadingly known as "antialiasing") in the geometry rendering, the engine is [subpixel](subpixel.md) accurate in rendering of the top and bottoms of the walls, i.e. the line these boundaries form may result in rasterizing slightly different pixels even if the start and end pixel is the same, depending on the subpixel position of the start and endpoint -- this feature doesn't much help in static screenshots but makes animation nicer.
Some **[interesting](interesting.md) places in code**: `m_random.c:31`: pseudorandom number table; `i_main.c`: the C main function (for DOS); `d_main.c:354`: game loop; `r_main.c:870`: 3D rendering function. `am_map.c:992`: variable named `fuck` (the code contains total of 20 lines containing "[fuck](fuck.md)").
## See Also
- [Anarch](anarch.md)

View file

@ -1,10 +1,10 @@
# Hexadecimal
Hexadecimal (also just *hex*) is a base-16 numeral system, very commonly used in [programming](programming.md) (alongside [binary](binary.md) and [octal](octal.md)). It basically works exactly the same as our traditional base 10 numeral system, but in addition to digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 adds also digits *A* (10), *B* (11), *C* (12), *D* (13), *E* (14) and *F* (15). In other words hexadecimal is nothing more than a different way of writing numbers -- for example instead of writing 123 in decimal we can write 7B in hexadecimal (to prevent confusion programmers often prefix hexadecimal numbers with `0x`, `#` and similar symbols, because sometimes a hexadecimal number may be formed with only digits 0 - 9 and could be confused with decimal number). Why is hexadecimal so special? Why 16? Why not just use normal decimal numbers? Well, this is out of convenience -- 16 is not an arbitrary number, it is a power of 2 (2^4 = 16); now since [digital](digital.md) [computers](computer.md) typically work with [bits](bit.md), i.e. 1s and 0s, groups of bits form binary numbers and these are (unlike decimal numbers) very easily converted to and from hexadecimal (exactly because the base 16 is a power of two base): it turns out that 4 bits (i.e. a group of 4 "1s and 0s") always convert exactly to one hexadecimal digit and vice versa, which is very nice and simplifies mental calculations. It also formats numbers nicely -- 8 bits will always be exactly 2 hexadecimal digits etc. That's basically all.
Hexadecimal (also just *hex*) is a base-16 numeral system, very commonly used in [programming](programming.md) (alongside [binary](binary.md) and [octal](octal.md)). It more or less works exactly the same as our traditional base 10 numeral system, but in addition to digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9 also includes digits *A* (10), *B* (11), *C* (12), *D* (13), *E* (14) and *F* (15). In other words hexadecimal is nothing more than a different way of writing numbers down -- for example instead of 123 in decimal we can write 7B in hexadecimal (to prevent confusion programmers frequently prefix hexadecimal numbers with `0x`, `#` and similar symbols, because oftentimes a hexadecimal number may only contain digits 0 - 9 and could be confused with a decimal number). Why is hexadecimal so special? Why 16? Why not just use normal decimal numbers? Well, this is out of convenience -- 16 is not an arbitrary number, it is a power of 2 (2^4 = 16); now since [digital](digital.md) [computers](computer.md) typically work with [bits](bit.md), i.e. 1s and 0s, groups of bits form binary numbers and these are (unlike decimal numbers) very easily converted to and from hexadecimal (exactly because the base 16 is a power of two base): it turns out that 4 bits (i.e. a group of 4 "1s and 0s") always convert exactly to one hexadecimal digit and vice versa, which is very nice and simplifies mental calculations. It also formats numbers nicely -- 8 bits will always be exactly 2 hexadecimal digits etc. That's basically all.
Hexadecimal is so common in programming that programmers often use the term "hex" or "hexadecimal" data to just mean "binary" data, e.g. as in "[hex editor](hex_editor.md)".
Hexadecimal is so widespread in programming that programmers often use the term "hex" or "hexadecimal" data to just mean "binary" data, e.g. as in "[hex editor](hex_editor.md)".
Let's try to make this a bit clearer with a table:
Let's try to clarify it all with a table:
| decimal | binary (2^1) | octal (2^3) | hexadecimal (2^4) |
| ------- | ------------ | ----------- | ----------- |
@ -28,7 +28,7 @@ Let's try to make this a bit clearer with a table:
| 17 | 10001 | 21 | 11 |
| 18 | 10010 | 22 | 12 |
The key thing to notice is that a group of 4 binary digits will always directly translate to one hexadecimal digit and vice versa according to the table above, so for example a binary number 00101110 will be converted to hexadecimal number 2E because 0010 translates to 2 and 1110 translates to E. Also notice this doesn't work the same with conversions to/from decimal numbers. As a programmer you should memorize the 16 pairs of hex digits and binary quadruplets so that you can quickly convert numbers in your head.
A key observation to make is that a group of 4 binary digits will always directly correspond to one hexadecimal digit and vice versa according to the table above, so for example a binary number 00101110 will be converted to hexadecimal number 2E because 0010 translates to 2 and 1110 translates to E. Also notice this doesn't work the same with conversions to/from decimal numbers. As a programmer you should memorize the 16 pairs of hex digits and binary quadruplets so that you can quickly convert numbers in your head.
The conversions work as in any other base, basically just remember this: *N*th digit from the right (starting with 0) says how many "16 to N"s there are. So for example a hexadecimal number E0A3 has 3 "16^0"s (1s), 10 (A) "16^1"s (16s), 0 "16^2"s (256s) and 14 "16^3"s (4096s), that's 3 * 1 + 10 * 16 + 0 * 256 + 14 * 4096 = 57507. Is it difficult? No.

View file

@ -14,6 +14,8 @@ Just like with Doom, the game's plot is simple and gives way to gameplay, it rev
In general the game is no longer as nice in its internals as Doom was, creeping of mainstream [capitalist](capitalism.md) [bullshit](bullshit.md) already started to show here.
The original system requirements were 8 MB of [RAM](ram.md), 80 MB of hard drive space and a 75 MHz [CPU](cpu.md).
The engine, also known as *Id Tech 2*, is written in [C89](c.md). The original source code release has just short of 100 [KLOC](loc.md). That's no longer really [suckless](suckless.md). The code itself looks alright, has consistent formatting and [comments](comment.md). The game was developed on [NeXTSTEP](nextstep.md). The engine is built around client-server architecture and allows a multiplayer of up to 32 players.
Quake engine features one highly embarrassing feature: a kind of [scripting](script.md) language called [QuakeC](quakec.md) (see also [HolyC](holyc.md)). This language compiled to [bytecode](bytecode.md) and allowed to mod the game without recompiling the engine (a feature that Doom engine lacked), which sounds cool and all, but it's [shit](shit.md): it's a new language, new compiler and huge [bloat](bloat.md).

File diff suppressed because it is too large Load diff

View file

@ -104,10 +104,11 @@ Some stereotypes are:
- [football](football.md) fans
- dislike French
- bad cuisine
- flappy ears
- **French**:
- good lovers, passionate
- lazy, Bohemian life, hate [work](work.md)
- eat baguettes and frogs
- eat baguettes and frogs (and other disgusting stuff like snails), drink wine
- dislike Brits
- revolutionaries, constantly protest, strikes
- artists, intellectuals
@ -130,24 +131,25 @@ Some stereotypes are:
- tough
- drunk and violent
- **Italian**:
- handsome men who are passionate lovers
- extremely passionate, have heated emotional arguments about even trivial things
- handsome men, great lovers
- extremely passionate, have heated emotional arguments even about trivial things
- involved with mafia
- great focus on family, know and regularly meet distant relatives
- prioritize family, know and regularly meet very distant relatives
- have mustaches, eat pizza and pasta
- talk with hands
- **Polish**:
- very religious Christians
- heavy drinkers
- ugly depressive environment
- miserable
- kurwa
- **Scandinavia**:
- cold, show no emotion
- extremely liberal politics, [SJWs](sjw.md)
- cold, show no emotion, talk a little
- extremely [liberal](liberalism.md) politics, [SJWs](sjw.md)
- **Finland**:
- thanks to sauna people don't know shame of nudity -- like in Japan you go to karaoke after work, in Finland you will go to sauna after work with your colleagues and boss, all naked of course
- **Norwegian**:
- vikings, big tall, strong, muscular blonde men
- vikings, big tall, strong, muscular blonde [gigachads](gigachad.md)
- metal music
- hunt whales
- **Swedish**:
@ -164,7 +166,7 @@ Some stereotypes are:
- poorer version of Czechs
- **Spanish**:
- extroverted, social, passionate, hot blooded, dance flamenco
- take naps on siesta
- take naps on siesta, literally sleep on work
- bullfighters
- attractive tanned men
- **Eskimos** (also Nanook):
@ -176,17 +178,17 @@ Some stereotypes are:
- good at [IT](it.md) but usually tech support scammers
- spiritual, peaceful, meditate a lot, do yoga
- don't know what work safety means
- transport extremely big loads on bicycles or small motorcycles
- transport gigantic loads on bicycles or small motorcycles
- "car horn is the national bird of India"
- Bollywood, extremely ridiculous and bizarre music and TV shows
- Bollywood, hilarious and bizarre music and TV shows
- **Israel**: see the jewish race
- **Mexican**:
- all wear sombreros and mustaches
- love and drink tequila all day
- extremely spicy food that would kill any non-Mexican
- lazy, poor, dirty, drugs and crime, violence
- have spiciest food on Earth, would kill any non-Mexican
- lazy, poor, dirty, drugs and crime, violence, cruel life
- constantly trying to get over US borders to steal their jobs
- those who already got into Murica work basically as slaves, e.g. cleaners, nannies, janitors etc.
- those already in the US work basically as slaves, e.g. cleaners, nannies, janitors etc.
- weapon of choice is machete
- **Russians**:
- very tough, big and strong, endure conditions that would kill other people (such as extreme cold or very high doses of alcohol), keep pet bears
@ -200,19 +202,22 @@ Some stereotypes are:
- good at [chess](chess.md)
- **by [races](race.md)**:
- **asian**:
- extremely smart and educated
- exceptionally smart and educated
- all look the same
- polite and humble
- don't show emotion
- very strict parents, children only expected to get As in school and must go to University else they'll be disowned
- work extremely hard
- small penises
- can't see because of weird eyes
- can't see because of weird slanted eyes
- men of honor
- martial arts, everyone knows at least Kung Fu or Karate
- collectivist, sacrifice themselves for society, individual's opinions and needs never matter
- weapons of choice include nunchaks, katana or throwing stars
- collectivist, sacrifice themselves for society (see [kamikaze](kamikaze.md)), individual's opinions and needs never matter
- there are too many of them, lives of the poor ones have no value, work safety of peasants is non existent
- very spiritual, mentally advanced, calm and balanced, deep insight and wisdom about philosophical questions
- rituals with gongs and simple single-string music, preparation of tea is a sacred act
- sense of respect and hierarchy, student-master relationships, value of mastery, old age and wisdom
- **[black](nigger.md)** (also negro):
- unintelligent, stupid, uneducated, primitive, poor, dirty, thieves and criminals
- physically fit, good at sports, run very fast, play basketball
@ -229,21 +234,24 @@ Some stereotypes are:
- children don't go to school, uneducated, can hardly read
- passionate, emotional, friendly
- talent for [music](music.md)
- live in caravans, constantly moving from place to place
- if they do work, it's only at a circus
- **[jews](jew.md)**:
- very smart, inventive
- greedy
- good at [business](business.md), filthy [capitalists](capitalism.md), just count money all day
- good at [business](business.md), filthy [capitalists](capitalism.md), just count [money](money.md) all day
- have the "eagle nose"
- members of secret societies, closed jew-only communities, conspire for world control, some being [fascists](fascism.md) wanting to become the ruling race
- spread everywhere like rats
- can adapt to any environment
- do all kinds of weird religious rituals
- do all kinds of weird religious rituals involving murders of non-jews and maybe even traveling to other planets
- **[slavs](slav.md)**:
- [trolls](troll.md)
- don't give a shit much about anything
- either poor or rich Russian mafia bosses
- cheap soviet stuff
- **[white](white.md)**
- pinnacle of [evolution](evolution.md), like Michelangelo's Davis is the peak of [art](art.md)
- pinnacle of [evolution](evolution.md), like Michelangelo's David is the peak of [art](art.md)
- smart, beautiful, generally good at everything
- average penis size
- privileged, rich, go to prestigious universities, wear suits, play golf, are members of VIP clubs
@ -259,11 +267,11 @@ Some stereotypes are:
- **[men](man.md)**:
- direct, strong, decisive, stubborn, overconfident, primitive, irresponsible, conservative, when provoked may easily become rude and aggressive, beat their wives
- [competitive](competition.md)
- good at [math](math.md) and exact sciences, often on detriment of being good at art, humanities and "soft skills" (these are seen as gay)
- hide their feelings, trash talk ever best friends, revealing feminine emotions is seen as a weakness and sign of [homosexuality](gay.md)
- good at [math](math.md) and exact [sciences](science.md), often on detriment of art, humanities and "soft skills" (these are seen as gay and left for women)
- hide their feelings, trash talk ever best friends, revealing feminine emotions is perceived as a weakness and sign of [homosexuality](gay.md)
- thinking only of [sex](sex.md), will have sex with every woman any time and everywhere, will have as many sexual partners as possible, however romantically will love only one woman, to the point of dying for her (but will rather die than marry her)
- obsessed with and insecure about penis size
- like cars, guns, military, machines in general, building and repairing "[do it yourself](dyi.md)" style, not reading manuals (that's for sissies)
- like [cars](car.md), guns, military, machines in general, building and repairing "[do it yourself](dyi.md)" style, not reading manuals (that's for sissies), playing with model trains
- at heart stay a little boy their whole lives, just need bigger and more expensive toys, never mature (from woman point of view)
- **[women](woman.md)** (may also apply to gay men):
- bad at driving, bad spatial skills
@ -281,8 +289,8 @@ Some stereotypes are:
- can distinguish and name different shades of similar colors
- on board of a ship bring bad luck
- love fashion, the color pink, Barbie dolls, cleaning, ironing, cooking etc.
- get good grades at school because of tryharding, memorization (without deep understanding), following rules and diligence, i.e. conformance (which the corrupt system rewards before talent and actual skill)
- secretly want to have sex with [dogs](dog.md) rather than with men
- get good grades at school because of tryharding, memorization (without deep understanding), following rules and diligence, i.e. conformance (which the corrupt system rewards before talent and actual skill), but still can't catch up to men at math
- secretly want to have sex with [dogs](dog.md) rather than men
- read manuals
- **blonde**, attractive ones:
- extremely stupid, even among women
@ -314,4 +322,5 @@ Some stereotypes are:
- [race](race.md)
- [political correctness](political_correctness.md)
- [jokes](jokes.md)
- [jokes](jokes.md)
- [languages](human_language.md)

File diff suppressed because one or more lines are too long

View file

@ -2,13 +2,13 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 636
- number of commits: 1000
- total size of all texts in bytes: 5294754
- total number of lines of article texts: 38252
- number of articles: 637
- number of commits: 1001
- total size of all texts in bytes: 5311358
- total number of lines of article texts: 38333
- number of script lines: 324
- occurrences of the word "person": 10
- occurrences of the word "nigger": 121
- occurrences of the word "nigger": 123
longest articles:
@ -35,60 +35,88 @@ longest articles:
top 50 5+ letter words:
- which (2909)
- there (2283)
- people (2184)
- example (1844)
- other (1647)
- about (1483)
- number (1357)
- software (1304)
- because (1222)
- their (1136)
- would (1101)
- something (1096)
- being (1086)
- which (2912)
- there (2291)
- people (2185)
- example (1846)
- other (1652)
- about (1485)
- number (1358)
- software (1311)
- because (1224)
- their (1137)
- would (1104)
- something (1098)
- being (1088)
- program (1069)
- language (1010)
- called (978)
- things (956)
- without (892)
- simple (883)
- language (1011)
- called (982)
- things (957)
- without (893)
- simple (884)
- function (874)
- computer (854)
- numbers (841)
- different (821)
- computer (857)
- numbers (842)
- different (824)
- these (797)
- however (796)
- however (797)
- programming (792)
- world (782)
- system (758)
- should (746)
- still (744)
- doesn (738)
- games (712)
- drummyfish (698)
- while (697)
- point (685)
- society (682)
- possible (677)
- world (783)
- system (759)
- should (752)
- still (747)
- doesn (741)
- games (714)
- drummyfish (699)
- while (698)
- point (690)
- society (683)
- possible (679)
- simply (670)
- probably (669)
- always (669)
- simply (667)
- probably (666)
- using (657)
- course (631)
- course (630)
- similar (623)
- actually (612)
- https (607)
- someone (603)
- actually (617)
- https (609)
- someone (604)
- though (593)
- really (587)
- first (586)
- basically (580)
- first (592)
- really (586)
- basically (582)
latest changes:
```
Date: Tue Apr 8 14:44:09 2025 +0200
4chan.md
ai.md
anorexia.md
avpd.md
chess.md
determinism.md
dramatica.md
drummyfish.md
faq.md
free_software.md
freedom.md
ioccc.md
jargon_file.md
lgbt.md
main.md
math.md
people.md
project.md
random_page.md
rule110.md
stereotype.md
wiki_pages.md
wiki_stats.md
wolf3d.md
woman.md
work.md
zoomer.md
Date: Thu Apr 3 21:49:43 2025 +0200
ascii_art.md
assembly.md
@ -100,35 +128,6 @@ Date: Thu Apr 3 21:49:43 2025 +0200
computational_complexity.md
doom.md
dungeons_and_dragons.md
faggot.md
fixed_point.md
free_culture.md
free_will.md
fun.md
golang.md
good_enough.md
human_language.md
julia_set.md
left_right.md
loc.md
love.md
lrs_wiki.md
main.md
pascal.md
random_page.md
raycastlib.md
regex.md
rms.md
trom.md
trump.md
ubi.md
usa.md
wiki_pages.md
wiki_stats.md
wirtual.md
woman.md
www.md
Date: Wed Apr 2 17:51:15 2025 +0200
```
most wanted pages:
@ -152,40 +151,40 @@ most wanted pages:
- [syntax](syntax.md) (8)
- [rape](rape.md) (8)
- [nazi](nazi.md) (8)
- [gpl](gpl.md) (8)
- [jew](jew.md) (8)
most popular and lonely pages:
- [lrs](lrs.md) (342)
- [lrs](lrs.md) (343)
- [capitalism](capitalism.md) (314)
- [c](c.md) (246)
- [bloat](bloat.md) (242)
- [free_software](free_software.md) (204)
- [game](game.md) (157)
- [c](c.md) (247)
- [bloat](bloat.md) (243)
- [free_software](free_software.md) (206)
- [game](game.md) (158)
- [suckless](suckless.md) (152)
- [proprietary](proprietary.md) (137)
- [proprietary](proprietary.md) (140)
- [modern](modern.md) (127)
- [minimalism](minimalism.md) (125)
- [computer](computer.md) (122)
- [minimalism](minimalism.md) (126)
- [computer](computer.md) (123)
- [censorship](censorship.md) (122)
- [kiss](kiss.md) (121)
- [censorship](censorship.md) (121)
- [programming](programming.md) (116)
- [shit](shit.md) (112)
- [fun](fun.md) (112)
- [math](math.md) (111)
- [fun](fun.md) (109)
- [gnu](gnu.md) (107)
- [woman](woman.md) (105)
- [linux](linux.md) (105)
- [woman](woman.md) (104)
- [corporation](corporation.md) (101)
- [history](history.md) (100)
- [corporation](corporation.md) (103)
- [history](history.md) (101)
- [bullshit](bullshit.md) (101)
- [fight_culture](fight_culture.md) (100)
- [bullshit](bullshit.md) (100)
- [art](art.md) (99)
- [art](art.md) (100)
- [hacking](hacking.md) (95)
- [less_retarded_society](less_retarded_society.md) (93)
- [free_culture](free_culture.md) (92)
- [programming_language](programming_language.md) (91)
- [work](work.md) (88)
- [work](work.md) (89)
- ...
- [free_body](free_body.md) (5)
- [explicit](explicit.md) (5)

View file

@ -14,7 +14,9 @@ The game was met with hilarious [censorship](censorship.md) as there are swastik
## Code/Engine
The game is written in [C89](c.md) (with some bits in [assembly](assembly.md)) and consists of 70 files that count roughly 30000 [lines of code](loc.md) (depending on how we count). Formatting and [comments](comment.md) look like garbage, tabs are mixed with spaces and stuff, a bunch of empty lines suddenly appear for no reasons, also great many ifdefs everywhere etc.
The game is written in [C89](c.md) (with some bits in [assembly](assembly.md)) and consists of 70 files that count roughly 30000 [lines of code](loc.md) (depending on how we count). Formatting and [comments](comment.md) look like garbage, tabs are mixed with spaces and stuff, a bunch of empty lines suddenly appear for no reasons, inconsistencies (sometimes a function is called like `f ()`, sometimes `f()`), also great many ifdefs everywhere etc. Yep, there are [gotos](goto.md) too.
System requirements were 528 KB [RAM](ram.md), 3 MB of disk space and 286 CPU (8 MHz).
Compared with Doom, Wolfenstein's code shows considerable [shittiness](shitty.md), for example in that the engine **isn't [deterministic](determinism.md)** and literally **uses [floating point](float.md)** (although it looks like float is only used to precompute tables and that actual real time logic then uses [fixed point](fixed_point.md) arithmetic, but still the [dependency](dependency.md) is there). Apparently there are slips and fails such as the pseudorandom number table not containing certain values, item pickups being part of rendering code (so items can't be picked up moving backwards), or a hardcoded FPS for demos due to the fact that with variable FPS the game isn't deterministic.
@ -28,6 +30,10 @@ A lesser known piece of trivia is that the [SNES](snes.md) port of Wolfenstein a
To quickly scale sprites and wall textures a clever [optimization](optimization.md) was used, called *scalers*. A scaler was essentially compiled code that would take an image and draw its scaled version without any parameters, branching or condition checking; the point is there was a scaler for every possible "stretch", so this is a kind of precomputation sacrificing memory to win speed. Precomputation is after all a theme present in the whole engine, just like in Doom -- there is a precomputed [sine](sin.md) table, table of [pseudorandom](pseudorandomness.md) numbers etc.
[AI](ai.md) is based on [finite state machine](fsm.md). Enemies always occupy a single square -- when changing square the motion is [interpolated](interpolation.md) to create an illusion of smooth motion. Thinking actors are represented by `objtype` struct. There is one remarkably advanced feature to the AI system: sound propagation. Enemies can be awoken when they hear a noise and this takes into account separate rooms and closed/open doors. This was again made possible by a precomputed table that marks parts of the map as "acoustically connected".
**[Interesting](interesting.md) places in code**: `ID_US_A.ASM:19`: pseudorandom number table; `WL_MAIN.C:1586`: the C main function; `WL_GAME.C: 1233`: game loop; `WL_PLAY.C:1368`: play loop (funnily there is a hint of some kind of [virtual reality](vr.md) support? See the variable `virtualreality`); `WL_DRAW.C:1336`: the raycasting function.
## See Also
- [Doom](doom.md)

12
work.md
View file

@ -80,17 +80,23 @@ Should you be so unlucky to [find no way](great_trap.md) of out of slavery, don'
- **janitor, cleaner**: Next to zero responsibility and stress, a labor that keeps not only the toilet cleans but also your mind, after getting used to the routine one can easily think about one's [projects](project.md) during the work.
- **interpreter**: Ideal for those speaking uncommon and/or difficult [language](human_language.md), simply paid for parroting what one hears. If you're smart, you can learn Japanese or Chinese in a few years with some dedication. Being a tourist guide can be comfy, you get enjoy fresh air and walks every day.
- **animal caretaker**: May be more emotionally and physically challenging, but also the more meaningful and admirable. Look for animal shelters, small farms etc.
- **caring for old/disabled/retarded people**: Like animal caretaker but with people, may require some qualification.
- **night guard, chair sitter**: Comfy, nobrainer job, a lot of times you're paid for simply staying awake at night and being alone, keeping an eye on someone's property, which normies find boring. If you're however one of the few who in fact crave nothing else than being left alone with a [book](books.md), this is exactly what you want to search for.
- **corpse cleaning, graveyard maintainer, ...**: Most people don't want to do this, so a great deal of pay may come simply from the fact that you are WILLING to do it. Spending time with corpses is better than spending time with live people, which is a big advantage.
- **leaflet distribution, mailman**: Daily exercise and fresh air, probably not talking to anyone much. Be careful about big [corporations](corporation.md) though, their delivery jobs are hell! Find something very small, a remote village where you walk on foot from house to house and just throw stuff in mailboxes.
- **teacher**: Can be stressful, difficult and requires education and dedication, but may also be fulfilling and satisfying to the more extroverted guys. The main advantage is the long holidays! Ideal is probably a half time teaching at a university as dealing with young kids in elementary and high school is probably an incredible pain in the ass.
- **prostitute**: Mostly for [women](woman.md), can be a pleasant way of making big money and subsequently having a lot of free time, but can be risky due to diseases, violence and [law](law.md).
- **prostitute**: Typically for [women](woman.md), can be a pleasant way of making big bucks and subsequently having a lot of free time, but can be risky due to diseases, violence, mafia and [law](law.md).
- **charity organizations, non-profits**: Again one of the more difficult and stressful options, but if an office work can't be avoided, then at least let it be something closer to ethical, non-corporate world.
- **street artist**: Earning money with live performance is much more [ethically](ethics.md) sane and healthy than supporting [copyright](copyright.md) and sitting on one's ass in front of a computer, plus you don't rely on distributors, recording studios, license lawyers, computers and other [bullshit](bullshit.md)/[bloat](bloat.md) and middle men. Just you, your art and your audience in the most genuine connection. Fresh air is also an advantage, imagine just practicing what you love every day and people paying you for watching. This doesn't have to be just [music](music.md), maybe you're a great painter, juggler, [chess](chess.md) players or a "living statue", anything goes if the crowd appreciates it.
- **human taxi**: The kind of non-motorized taxis like rickshaws don't pollute air, don't require as much [maintenance](maintenance.md), licenses and all this crap, plus you are literally paid for working out. The issue is that this may only be viable in a bigger city with a lot of competition and stinky air.
- **[free software](free_software.md)**: Working with computers is actually discouraged, not only because of all the [suicide](suicide.md) inducing [toxicity](toxic.md), but also because it generally ties one to a computer too much, considering that free time is nowadays also spent predominantly behind a computer. But should there be no other option, helping ethical computing is at lest the best that can be done.
- **simple manual jobs**: E.g. helping out at some small farm, construction (for those who want to work out), handicraft, ...
- **tutoring**: Find retards who need tutoring to pass classes and just teach them. Advantage: girls may pay with sex :)
- **some kinda work in churches**: Like helping with maintenance, cleaning, gardening, whatever. Hopefully priests won't be such asshole employers like corporate suits.
- **public library?**: May be comfy for bookworms, but also stressful at times (dealing with people and computers).
- **simple manual jobs**: E.g. helping out at some small farm, construction (for those who want to work out), handicraft, moving furniture, ...
- ...
**What to avoid**: mainly works for [corporations](corporation.md), office jobs, jobs in big cities, working with people and [computers](computer.md), anything with responsibility and high salary, shitty, unhealthy and dangerous environments such as factories.
**What to avoid**: mainly work for [corporations](corporation.md), office jobs, jobs in big cities, working with people and [computers](computer.md), anything with responsibility and high salary, shitty, unhealthy and dangerous environments such as factories, unethical shit (supporting [copyright](copyright.md), [capitalism](capitalism.md), [consumerism](consumerism.md), ...).
## See Also