├── LICENSE ├── README.md ├── bin └── boot.o └── minimalboot.asm /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Ch4r0nN λ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MinimalBoot 2 | A small example of an assembly bootloader 3 | 4 | ## Requirements 5 | 6 | • Have the BIOS customized 7 | 8 | ### Features 9 | 10 | • A simple and clean code bootloader 11 | 12 | • Change color randomly thus leaving a modern look 13 | -------------------------------------------------------------------------------- /bin/boot.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thebigcicca/MinimalBoot/1d933dea22a570129f85602682c2eff33c428f6c/bin/boot.o -------------------------------------------------------------------------------- /minimalboot.asm: -------------------------------------------------------------------------------- 1 | [ORG 0x7C00] 2 | mov ah, 0x02 3 | mov al, 0x01 4 | mov ch, 0x00 5 | mov cl, 0x02 6 | mov dh, 0x01 7 | mov es, [EXTENSION] 8 | mov bx, 0x00 9 | int 13h 10 | jmp PRINT 11 | 12 | MSG: db 'Welcome to my OS',0xa,13,10,0x00 13 | 14 | times 510-($-$$) db 0 15 | db 0x55 16 | db 0xAA 17 | 18 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 19 | EXTENSION: 20 | mov ah, 0x00; Contains the type of function 21 | mov al, 0x13 22 | int 0x10 23 | ; PARAMETERS 24 | mov al, 0x01 ; The pixel color 25 | mov bh, 0x00 ; The page number 26 | mov cx, 0x00 ; X Position 27 | mov dx, 0x00 ; Y Position 28 | 29 | 30 | LOOP: 31 | mov ah, 0x0C 32 | int 0x10 ; Video function 33 | je RESETCOLLOR 34 | inc cx ; Advance to the right pixel 35 | cmp cx, 0x0140 ; Checks if it is 320 36 | jne LOOP ; Continued if not 320 37 | mov cx, 0x00 ; Returns to position 0 of the X axis 38 | inc dx ; Advance to the next line 39 | cmp dx, 0xC8 ; Checks if it reached the last line 40 | jne LOOP 41 | mov dx, 0x00 ; Back to the first line 42 | inc al ; Jump to the next color 43 | cmp al, 0xFF ; Check if it is the last color 44 | je RESETCOLLOR 45 | jmp LOOP 46 | RESETCOLLOR: 47 | mov al, 0x00 ; Collor reset 48 | jmp LOOP 49 | PRINT: 50 | xor ax, ax ; Reset acumulator 51 | mov ds, ax 52 | mov si, MSG 53 | CHAR_PRINT: lodsb 54 | or al, al ; Checks if the value is 0 55 | jz WAITNG ; Loop until you turn off the computer 56 | mov ah, 0x0E 57 | int 0x10 58 | jmp CHAR_PRINT ; Jump to the next character 59 | WAITNG: 60 | jmp WAITNG 61 | --------------------------------------------------------------------------------