├── run.sh ├── linker.ld ├── kmain.cpp ├── include ├── asm.h └── kb.h ├── README.md ├── kernel.asm ├── winsis ├── vgasrc.cpp └── qwerty.cpp └── LICENSE /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | qemu-kvm kernel.iso 3 | 4 | -------------------------------------------------------------------------------- /linker.ld: -------------------------------------------------------------------------------- 1 | ENTRY(boot) 2 | OUTPUT_FORMAT("binary") 3 | SECTIONS { 4 | . = 0x7c00; 5 | .text : 6 | { 7 | *(.boot) 8 | *(.text) 9 | } 10 | 11 | .rodata : 12 | { 13 | *(.rodata) 14 | } 15 | 16 | .data : 17 | { 18 | *(.data) 19 | } 20 | 21 | .bss : 22 | { 23 | *(.bss) 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /kmain.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "include/asm.h" 4 | #include "winsis/vgasrc.cpp" 5 | #include 6 | #include 7 | 8 | extern "C" void kmain(int framebuffer, int bpp) 9 | { 10 | // Deprecated command line mode 11 | } 12 | extern "C" void wmain(int32_t framebuffer, int bpp) 13 | { 14 | vgakurulum(framebuffer); 15 | 16 | while(0){} 17 | } 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /include/asm.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | uint8_t inb(uint16_t port) 5 | { 6 | uint8_t ret; 7 | asm volatile ( "inb {%[port], %[retreg] | %[retreg], %[port]}" 8 | : [retreg]"=a"(ret) 9 | : [port]"Nd"(port) ); 10 | return ret; 11 | } 12 | //Sends a 8/16/32-bit value on a I/O location. Traditional names are outb, outw and outl respectively. 13 | void outb(uint16_t port, uint8_t byte) 14 | { 15 | asm volatile ( "outb {%[byte], %[port] | %[port], %[byte]}" 16 | : 17 | : [byte]"a"(byte), 18 | [port]"Nd"(port) ); 19 | } 20 | void outw(uint16_t port, uint16_t byte) 21 | { 22 | asm volatile ( "outw {%[byte], %[port] | %[port], %[byte]}" 23 | : 24 | : [byte]"a"(byte), 25 | [port]"Nd"(port) ); 26 | } 27 | 28 | void io_wait(void) 29 | { 30 | outb (0x80, 0); 31 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IsolatedOS 2 | Alien Isolation inspired fan made 32 bit real operating system. This operating system consist of it's own bootloader and -very- little kernel which not derived from Linux or something. 3 | # Installation 4 | Download ISO file in releases page and use an emulator to run it. 5 | Operating system can be run in legacy bios mode on any computer in theory but **I strongly suggest you to run it on virtual device**. 6 | # How to build 7 | ## Required Packages 8 | Install the required packages to compile operating system. 9 | ```bash 10 | gcc 11 | nasm 12 | qemu-kvm 13 | ``` 14 | Note: qemu-kvm package is required for testing iso 15 | ## Build Scripts 16 | Open a terminal in project root directory and run script files. 17 | ```bash 18 | chmod +x build.sh 19 | chmod +x run.sh 20 | ./build.sh 21 | ./run.sh 22 | ``` 23 | To build and run 24 | ```bash 25 | ./build.sh && ./run.sh 26 | ``` 27 | # How to change messages in OS 28 | To change messages in OS open vgasrc.cpp file in winsis directory and change following lines. 29 | ```cpp 30 | // PERSONAL: 31 | #define _PersonalCount 2 32 | const char* personal_title = "CONFIGURING MESSAGES"; 33 | const char* personal[_PersonalCount] = { 34 | "ALL MESSAGES CAN BE EDITTED ON TOP OF THE VGASRC CPP SOURCE", 35 | "FILE" 36 | }; 37 | 38 | // UTILITIES 39 | #define _UtilitiesCount 1 40 | const char* utilities_title = "COMPILATION OF SOURCE"; 41 | const char* utilities[_UtilitiesCount] = { 42 | "LOOK AT BUILD SHELL FILE" 43 | }; 44 | 45 | // ABOUT 46 | #define _AboutCount 5 47 | const char* about_title = "ABOUT ISOLATED OS"; 48 | const char* about[_AboutCount] = { 49 | "ISOLATED OS VERSION A", 50 | "THIS OPERATING SYSTEM IS DEVELOPED FOR ENTERTAINMENT PURPOSES", 51 | "INSPIRED BY FAMOUS VIDEO GAME AND NOT RELATED WITH ANY TRADEMARK", 52 | "OF IT", 53 | "PROJECT LICENSED UNDER GPL VERSION TWO" 54 | }; 55 | ``` 56 | If you change the line count you should change '_PersonalCount, _UtilitiesCount or _AboutCount' as well. 57 | # Login Password 58 | Default login password is 'ADMIN'.
59 | You can change password in vgasrc.cpp file. 60 | ```cpp 61 | const char* passwd = "ADMIN"; 62 | 63 | ``` 64 | 65 | # Gallery 66 | 67 | resim 68 | resim 69 | resim 70 | resim 71 | 72 | # License 73 | ``` 74 | Copyright (C) 2021 Yusuf K. Hanoğlu 75 | This program is free software; you can redistribute it and/or 76 | modify it under the terms of the GNU General Public License 77 | as published by the Free Software Foundation; version 2 78 | of the License. 79 | This program is distributed in the hope that it will be useful, 80 | but WITHOUT ANY WARRANTY; without even the implied warranty of 81 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 82 | GNU General Public License for more details. 83 | You should have received a copy of the GNU General Public License 84 | along with this program; if not, write to the Free Software 85 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 86 | 87 | ``` 88 | 89 | # Disclaimer 90 | This project is developed for **entertainment only** and is **not related** with aforementioned game or any of it's trademark. 91 | -------------------------------------------------------------------------------- /include/kb.h: -------------------------------------------------------------------------------- 1 | #ifndef KB_H 2 | #define KB_H 3 | 4 | 5 | 6 | const char* readStr() 7 | { 8 | char buff; 9 | const char* buffstr; 10 | int i = 0; 11 | uint8 reading = 1; 12 | 13 | while(reading) 14 | { 15 | if(inportb(0x64) & 0x1) 16 | { 17 | switch(inportb(0x60)) 18 | { 19 | /*case 1: 20 | printch('(char)27); Escape button 21 | buffstr[i] = (char)27; 22 | i++; 23 | break;*/ 24 | case 2: 25 | printch('1'); 26 | buffstr[i] = '1'; 27 | i++; 28 | break; 29 | case 3: 30 | printch('2'); 31 | buffstr[i] = '2'; 32 | i++; 33 | break; 34 | case 4: 35 | printch('3'); 36 | buffstr[i] = '3'; 37 | i++; 38 | break; 39 | case 5: 40 | printch('4'); 41 | buffstr[i] = '4'; 42 | i++; 43 | break; 44 | case 6: 45 | printch('5'); 46 | buffstr[i] = '5'; 47 | i++; 48 | break; 49 | case 7: 50 | printch('6'); 51 | buffstr[i] = '6'; 52 | i++; 53 | break; 54 | case 8: 55 | printch('7'); 56 | buffstr[i] = '7'; 57 | i++; 58 | break; 59 | case 9: 60 | printch('8'); 61 | buffstr[i] = '8'; 62 | i++; 63 | break; 64 | case 10: 65 | printch('9'); 66 | buffstr[i] = '9'; 67 | i++; 68 | break; 69 | case 11: 70 | printch('0'); 71 | buffstr[i] = '0'; 72 | i++; 73 | break; 74 | case 12: 75 | printch('-'); 76 | buffstr[i] = '-'; 77 | i++; 78 | break; 79 | case 13: 80 | printch('='); 81 | buffstr[i] = '='; 82 | i++; 83 | break; 84 | case 14: 85 | printch('\b'); 86 | i--; 87 | buffstr[i] = 0; 88 | break; 89 | /* case 15: 90 | printch('\t'); Tab button 91 | buffstr[i] = '\t'; 92 | i++; 93 | break;*/ 94 | case 16: 95 | printch('q'); 96 | buffstr[i] = 'q'; 97 | i++; 98 | break; 99 | case 17: 100 | printch('w'); 101 | buffstr[i] = 'w'; 102 | i++; 103 | break; 104 | case 18: 105 | printch('e'); 106 | buffstr[i] = 'e'; 107 | i++; 108 | break; 109 | case 19: 110 | printch('r'); 111 | buffstr[i] = 'r'; 112 | i++; 113 | break; 114 | case 20: 115 | printch('t'); 116 | buffstr[i] = 't'; 117 | i++; 118 | break; 119 | case 21: 120 | printch('y'); 121 | buffstr[i] = 'y'; 122 | i++; 123 | break; 124 | case 22: 125 | printch('u'); 126 | buffstr[i] = 'u'; 127 | i++; 128 | break; 129 | case 23: 130 | printch('i'); 131 | buffstr[i] = 'i'; 132 | i++; 133 | break; 134 | case 24: 135 | printch('o'); 136 | buffstr[i] = 'o'; 137 | i++; 138 | break; 139 | case 25: 140 | printch('p'); 141 | buffstr[i] = 'p'; 142 | i++; 143 | break; 144 | case 26: 145 | printch('['); 146 | buffstr[i] = '['; 147 | i++; 148 | break; 149 | case 27: 150 | printch(']'); 151 | buffstr[i] = ']'; 152 | i++; 153 | break; 154 | case 28: 155 | // printch('\n'); 156 | // buffstr[i] = '\n'; 157 | i++; 158 | reading = 0; 159 | break; 160 | /* case 29: 161 | printch('q'); Left Control 162 | buffstr[i] = 'q'; 163 | i++; 164 | break;*/ 165 | case 30: 166 | printch('a'); 167 | buffstr[i] = 'a'; 168 | i++; 169 | break; 170 | case 31: 171 | printch('s'); 172 | buffstr[i] = 's'; 173 | i++; 174 | break; 175 | case 32: 176 | printch('d'); 177 | buffstr[i] = 'd'; 178 | i++; 179 | break; 180 | case 33: 181 | printch('f'); 182 | buffstr[i] = 'f'; 183 | i++; 184 | break; 185 | case 34: 186 | printch('g'); 187 | buffstr[i] = 'g'; 188 | i++; 189 | break; 190 | case 35: 191 | printch('h'); 192 | buffstr[i] = 'h'; 193 | i++; 194 | break; 195 | case 36: 196 | printch('j'); 197 | buffstr[i] = 'j'; 198 | i++; 199 | break; 200 | case 37: 201 | printch('k'); 202 | buffstr[i] = 'k'; 203 | i++; 204 | break; 205 | case 38: 206 | printch('l'); 207 | buffstr[i] = 'l'; 208 | i++; 209 | break; 210 | case 39: 211 | printch(';'); 212 | buffstr[i] = ';'; 213 | i++; 214 | break; 215 | case 40: 216 | printch((char)44); // Single quote (') 217 | buffstr[i] = (char)44; 218 | i++; 219 | break; 220 | case 41: 221 | printch((char)44); // Back tick (`) 222 | buffstr[i] = (char)44; 223 | i++; 224 | break; 225 | /* case 42: Left shift 226 | printch('q'); 227 | buffstr[i] = 'q'; 228 | i++; 229 | break; 230 | case 43: \ (< for somekeyboards) 231 | printch((char)92); 232 | buffstr[i] = 'q'; 233 | i++; 234 | break;*/ 235 | case 44: 236 | printch('z'); 237 | buffstr[i] = 'z'; 238 | i++; 239 | break; 240 | case 45: 241 | printch('x'); 242 | buffstr[i] = 'x'; 243 | i++; 244 | break; 245 | case 46: 246 | printch('c'); 247 | buffstr[i] = 'c'; 248 | i++; 249 | break; 250 | case 47: 251 | printch('v'); 252 | buffstr[i] = 'v'; 253 | i++; 254 | break; 255 | case 48: 256 | printch('b'); 257 | buffstr[i] = 'b'; 258 | i++; 259 | break; 260 | case 49: 261 | printch('n'); 262 | buffstr[i] = 'n'; 263 | i++; 264 | break; 265 | case 50: 266 | printch('m'); 267 | buffstr[i] = 'm'; 268 | i++; 269 | break; 270 | case 51: 271 | printch(','); 272 | buffstr[i] = ','; 273 | i++; 274 | break; 275 | case 52: 276 | printch('.'); 277 | buffstr[i] = '.'; 278 | i++; 279 | break; 280 | case 53: 281 | printch('/'); 282 | buffstr[i] = '/'; 283 | i++; 284 | break; 285 | case 54: 286 | printch('.'); 287 | buffstr[i] = '.'; 288 | i++; 289 | break; 290 | case 55: 291 | printch('/'); 292 | buffstr[i] = '/'; 293 | i++; 294 | break; 295 | /*case 56: 296 | printch(' '); Right shift 297 | buffstr[i] = ' '; 298 | i++; 299 | break;*/ 300 | case 57: 301 | printch(' '); 302 | buffstr[i] = ' '; 303 | i++; 304 | break; 305 | } 306 | } 307 | } 308 | buffstr[i] = 0; 309 | return buffstr; 310 | } 311 | #endif -------------------------------------------------------------------------------- /kernel.asm: -------------------------------------------------------------------------------- 1 | ;kernel.asm 2 | ;Copyright (C) 2021 Yusuf K. Hanoğlu 3 | ;This program is free software; you can redistribute it and/or 4 | ;modify it under the terms of the GNU General Public License 5 | ;as published by the Free Software Foundation; version 2 6 | ;of the License. 7 | ;This program is distributed in the hope that it will be useful, 8 | ;but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | ;GNU General Public License for more details. 11 | ;You should have received a copy of the GNU General Public License 12 | ;along with this program; if not, write to the Free Software 13 | ;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 14 | 15 | section .boot 16 | bits 16 17 | global boot 18 | boot: 19 | 20 | jmp word 0:flush ;#FAR jump so that you set CS to 0. (the first argument is what segment to jump to. The argument(after the `:`) is what offset to jump to) 21 | ;# Without the far jmp, CS could be `0x7C0` or something similar, which will means that where the assembler thinks the code is loaded and where your computer loaded the code is different. Which in turn messes up the absolute addresses of labels. 22 | flush: ;#We go to here, but we do it ABSOLUTE. So with this, we can reset the segment and offset of where our code is loaded. 23 | mov BP,0 ;#use BP as a temp register 24 | mov DS,BP ;#can not assign segment registers a literal number. You have to assign to a register first. 25 | mov ES,BP ;#do the same here too 26 | ;#without setting DS and ES, they could have been loaded with the old 0x7C0, which would mess up absolute address calculations for data. 27 | jmp devam1 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | enable_vesa: 36 | pusha 37 | vbe_get_info: 38 | 39 | mov ah, 4Fh; Super VGA support 40 | mov al, 00h; Return Super VGA information 41 | mov di, vbe_info; Pointer to buffer 42 | 43 | int 0x10; 44 | 45 | cmp ax, 0x4F ; BIOS doesn't support VBE? 46 | call error 47 | 48 | get_mode_info: 49 | 50 | mov ax, 4F01h; Return mode information 51 | mov cx, 0x105;[vbe_info.video_modes]; first mode 0x101 52 | mov di, mode_info; Pointer to buffer 53 | 54 | int 0x10; 55 | 56 | cmp ax, 0x4F ; BIOS doesn't support VBE? 57 | call error 58 | 59 | ;jmp komutmodu 60 | popa 61 | ret 62 | 63 | draw: 64 | 65 | ;Assume first window is valid 66 | mov ax, WORD [es:mode_info + 08h] 67 | mov es, ax 68 | 69 | ;Example of how to change the window 70 | mov ax, 4f05h 71 | xor bx, bx 72 | mov dx, 5 ;This is granularity units 73 | int 10h 74 | 75 | ;fist atempt 76 | mov edi, [mode_info.framebuffer]; framebuffer 77 | add edi, 290050; pixel_offset = y * pitch + ( x * ( bpp/8 )) + framebuffer; 78 | mov al,0x0F; the color of the pixel 79 | mov [edi], al 80 | 81 | 82 | 83 | 84 | 85 | 86 | error: 87 | popa 88 | 89 | pusha 90 | ret 91 | yazdir: 92 | pusha 93 | mov ah, 0x0e 94 | yazdir_1: 95 | lodsb 96 | int 10h 97 | cmp al,0 98 | jnz yazdir_1 99 | popa 100 | ret 101 | 102 | devam1: 103 | 104 | ;mov edi,0x0A0000 105 | ;mov al,0x0F 106 | ;mov [edi],al 107 | 108 | ;mov [disk],dl 109 | 110 | mov ah, 0x02 ;read sectors 111 | mov al, 0x40 ; 0x40 sectors to read 112 | mov ch, 0 ;cylinder idx 113 | mov dh, 0 ;head idx 114 | mov cl, 2 ;sector idx 115 | mov dl, 0x80 ;disk idx [disk] 116 | mov bx, copy_target;target pointer 117 | 118 | ;push bx 119 | ;mov bx,0x0000 120 | ;mov es,bx 121 | ;pop bx 122 | ;mov bx,copy_target 123 | 124 | int 0x13 125 | jc disk_hatasi 126 | 127 | mov ax, 0x3 128 | int 0x10 129 | 130 | ;vga 131 | mov ax, 0x2401 132 | int 0x15 133 | ;0x3 text mode 134 | ;mov ax, 0x13 135 | ;int 0x10 136 | 137 | 138 | call enable_vesa 139 | 140 | mov ax, 0x4F02 141 | mov bx, 0105h;0105h vesa video mode 1024x768 256C ilk bit lfb 142 | ;0107h vesa video mode 1280x1024 256C 143 | ;011Ch vesa video mode 1600x1200 256C 144 | int 0x10 145 | 146 | 147 | 148 | 149 | call enable_vesa 150 | 151 | mov ax, 0x4F02 152 | mov bx, 0105h;0105h vesa video mode 1024x768 256C ilk bit lfb 153 | ;0107h vesa video mode 1280x1024 256C 154 | ;011Ch vesa video mode 1600x1200 256C 155 | int 0x10 156 | 157 | jmp devam3 158 | 159 | komutmodu: 160 | mov [hangi_mod], byte 1 161 | mov ax, 0x2401 162 | int 0x15 163 | ;0x3 text mode 164 | mov ax, 0x3 165 | int 0x10 166 | 167 | devam3: 168 | ;disk okuma isleminin eski konumu 169 | 170 | jmp devam2 171 | disk_hatasi: 172 | mov si, disk_hata_mesaji 173 | call yazdir 174 | disk_hatasi_1: 175 | jmp disk_hatasi_1 176 | 177 | popa 178 | ret 179 | devam2: 180 | cli 181 | lgdt [gdt_pointer] 182 | mov eax, cr0 183 | or eax,1 184 | mov cr0, eax 185 | mov ax, DATA_SEG 186 | mov ds, ax 187 | mov es, ax 188 | mov fs, ax 189 | mov gs, ax 190 | mov ss, ax 191 | jmp CODE_SEG:boot2 192 | ;jmp 0x0000:boot2 193 | gdt_start: 194 | dq 0x0 195 | gdt_code: 196 | dw 0xFFFF 197 | dw 0x0 198 | db 0x0 199 | db 10011010b 200 | db 11001111b 201 | db 0x0 202 | gdt_data: 203 | dw 0xFFFF 204 | dw 0x0 205 | db 0x0 206 | db 10010010b 207 | db 11001111b 208 | db 0x0 209 | gdt_end: 210 | gdt_pointer: 211 | dw gdt_end - gdt_start 212 | dd gdt_start 213 | disk: 214 | db 0x0 215 | CODE_SEG equ gdt_code - gdt_start 216 | DATA_SEG equ gdt_data - gdt_start 217 | disk_hata_mesaji: db "Disk read ERROR",0x000a,0x000d,0 218 | hangi_mod: db 0 219 | times 510 - ($-$$) db 0 220 | dw 0xaa55 221 | section .bss 222 | vbe_info: 223 | 224 | .signature db "VBE2"; // must be "VESA" to indicate valid VBE support 225 | .version resw 1; // VBE version; high byte is major version, low byte is minor version 226 | .oem resd 1; // segment:offset pointer to OEM 227 | .capabilities resd 1; // bitfield that describes card capabilities 228 | .video_modes resd 1; // segment:offset pointer to list of supported video modes 229 | .video_memory resw 1; // amount of video memory in 64KB blocks 230 | .software_rev resw 1; // software revision 231 | .vendor resd 1; // segment:offset to card vendor string 232 | .product_name resd 1; // segment:offset to card model name 233 | .product_rev resd 1; // segment:offset pointer to product revision 234 | .reserved resb 222; // reserved for future expansion 235 | .oem_data resb 256; // OEM BIOSes store their strings in this area 236 | 237 | mode_info: 238 | 239 | .attributes resw 1; // deprecated, only bit 7 should be of interest to you, and it indicates the mode supports a linear frame buffer. 240 | .window_a resb 1; // deprecated 241 | .window_b resb 1; // deprecated 242 | .granularity resw 1; // deprecated; used while calculating bank numbers 243 | .window_size resw 1; 244 | .segment_a resw 1; 245 | .segment_b resw 1; 246 | .win_func_ptr resd 1; // deprecated; used to switch banks from protected mode without returning to real mode 247 | .pitch resw 1; // number of bytes per horizontal line 248 | .width resw 1; // width in pixels 249 | .height resw 1; // height in pixels 250 | .w_char resb 1; // unused... 251 | .y_char resb 1; // ... 252 | .planes resb 1; 253 | .bpp resb 1; // bits per pixel in this mode 254 | .banks resb 1; // deprecated; total number of banks in this mode 255 | .memory_model resb 1; 256 | .bank_size resb 1; // deprecated; size of a bank, almost always 64 KB but may be 16 KB... 257 | .image_pages resb 1; 258 | .reserved0 resb 1; 259 | 260 | .red_mask resb 1; 261 | .red_position resb 1; 262 | .green_mask resb 1; 263 | .green_position resb 1; 264 | .blue_mask resb 1; 265 | .blue_position resb 1; 266 | .reserved_mask resb 1; 267 | .reserved_position resb 1; 268 | .direct_color_attributes resb 1; 269 | 270 | .framebuffer resd 1; // physical address of the linear frame buffer; write here to draw to the screen 271 | .off_screen_mem_off resd 1; 272 | .off_screen_mem_size resw 1; // size of memory in the framebuffer but not being displayed on the screen 273 | .reserved1 resb 206; 274 | 275 | 276 | section .boot 277 | 278 | 279 | copy_target: 280 | bits 32 281 | hello: db " IsolatedOS Version: A ",0 282 | boot2: 283 | 284 | ; Disable blink 285 | ; Read I/O Address 0x03DA to reset index/data flip-flop 286 | mov dx, 0x03DA 287 | in al, dx 288 | ; Write index 0x30 to 0x03C0 to set register index to 0x30 289 | mov dx, 0x03C0 290 | mov al, 0x30 291 | out dx, al 292 | ; Read from 0x03C1 to get register contents 293 | inc dx 294 | in al, dx 295 | ; Unset Bit 3 to disable Blink 296 | and al, 0xF7 297 | ; Write to 0x03C0 to update register with changed value 298 | dec dx 299 | out dx, al 300 | 301 | 302 | 303 | mov esi,hello 304 | mov ebx,0xb8000 305 | .loop: 306 | lodsb 307 | or al,al 308 | jz halt 309 | or eax,0xe000 ;0x0F00 310 | mov word [ebx], ax 311 | add ebx,2 312 | jmp .loop 313 | halt: 314 | 315 | mov esp,kernel_stack_top 316 | cmp [hangi_mod],byte 1 317 | jz sadecekomut 318 | extern wmain 319 | 320 | 321 | 322 | mov edi, [mode_info.framebuffer] 323 | push edi 324 | call wmain 325 | jmp devam4 326 | sadecekomut: 327 | extern kmain 328 | call kmain 329 | devam4: 330 | 331 | cli 332 | hlt 333 | 334 | section .bss 335 | align 4 336 | kernel_stack_bottom: equ $ 337 | resb 16384 ; 16 KB 338 | kernel_stack_top: 339 | -------------------------------------------------------------------------------- /winsis/vgasrc.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | vgasrc.cpp 3 | Copyright (C) 2021 Yusuf K. Hanoğlu 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; version 2 7 | of the License. 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 | */ 16 | 17 | 18 | #include 19 | #include "qwerty.cpp" 20 | 21 | // Password 22 | const char* passwd = "ADMIN"; 23 | 24 | // PERSONAL: 25 | #define _PersonalCount 2 26 | const char* personal_title = "CONFIGURING MESSAGES"; 27 | const char* personal[_PersonalCount] = { 28 | "ALL MESSAGES CAN BE EDITTED ON TOP OF THE VGASRC CPP SOURCE", 29 | "FILE" 30 | }; 31 | 32 | // UTILITIES 33 | #define _UtilitiesCount 1 34 | const char* utilities_title = "COMPILATION OF SOURCE"; 35 | const char* utilities[_UtilitiesCount] = { 36 | "LOOK AT BUILD SHELL FILE" 37 | }; 38 | 39 | // ABOUT 40 | #define _AboutCount 5 41 | const char* about_title = "ABOUT ISOLATED OS"; 42 | const char* about[_AboutCount] = { 43 | "ISOLATED OS VERSION A", 44 | "THIS OPERATING SYSTEM IS DEVELOPED FOR ENTERTAINMENT PURPOSES", 45 | "INSPIRED BY FAMOUS VIDEO GAME AND NOT RELATED WITH ANY TRADEMARK", 46 | "OF IT", 47 | "PROJECT LICENSED UNDER GPL VERSION TWO" 48 | }; 49 | 50 | void ppx(char,int,int); // Put pixel 51 | void ppx(char,int32_t); // Put pixel 52 | void prc(char,int,int,int,int); // Put rectangle 53 | void pbr(char,char,int,int,int,int,int,int); // Put blank rectangle function 54 | void message(const char*); 55 | void print(char, int,int,int,int); 56 | void print(char,int,int,const char*,int); 57 | void print(char, int,int,int); 58 | void print(char,int,int,const char*); 59 | int pxlength(const char *); 60 | int ccsize2(const char*); 61 | int csize2(char *); 62 | int initmenu(); 63 | 64 | static int32_t framebufferloc = 0; 65 | 66 | const int screen_x = 1024; 67 | const int screen_y = 768; 68 | const int olu_pixel = 0;//254 69 | 70 | void ppx(char color, int x, int y){ 71 | 72 | int b; 73 | int32_t pxloc = framebufferloc; 74 | pxloc += screen_x*y;//320 75 | //319,199 76 | pxloc += x; 77 | 78 | 79 | ppx(color, pxloc); 80 | 81 | 82 | return; 83 | 84 | } 85 | void ppx(char color,int32_t pos){ 86 | int b; 87 | pos+=olu_pixel; 88 | asm( "movl %1, %%edi;" 89 | :"=r"(b) 90 | :"r"(pos) 91 | :"%edi" 92 | ); 93 | 94 | //asm( "addl $400000,%edi"); 95 | asm( "movb %1, %%al" 96 | :"=r"(b) 97 | :"r"(color) 98 | :"%al"); 99 | 100 | asm( "movb %al,(%edi)"); 101 | 102 | 103 | } 104 | void prc(char color, int basx, int basy, int sonx, int sony){ 105 | for(int i=0;i0){ 316 | guvenlik_i--; 317 | guvenlik[guvenlik_i]=0; } 318 | } 319 | else if(guvenlik_i==19){} 320 | else if(ch=='Q'||ch=='W'||ch=='E'||ch=='R'||ch=='T'||ch=='Y'||ch=='U'||ch=='I'||ch=='O'||ch=='P'||ch=='A'||ch=='S'||ch=='D'||ch=='F'||ch=='G'||ch=='H'||ch=='J'||ch=='K'||ch=='L'||ch=='Z'||ch=='X'||ch=='C'||ch=='V'||ch=='B'||ch=='N'||ch=='M'){ 321 | guvenlik[guvenlik_i]=ch; 322 | guvenlik_i++; 323 | } 324 | } 325 | 326 | if(!ccesit2(guvenlik,passwd)){ 327 | for(int i=0;i<5;i++){ 328 | if(b){ 329 | prc(0x04,(screen_x-olu_pixel-uxSignIn)/2,(screen_y-uySignIn)/2,uxSignIn,uySignIn); 330 | print(0x00,(screen_x-olu_pixel-uxSignIn)/2+pxlength("ACCESSADENIED")/5+5,(screen_y-uySignIn)/2+uySignIn/2-5-30-30,"ACCESS DENIED", 4); 331 | }else{ 332 | for(long k=0;k<8000;k++) 333 | for(long l = 0;l<99999;l++) 334 | d=(4000*8)/56*0.4; 335 | 336 | prc(0x00,0,0,screen_x,screen_y); 337 | for(long k=0;k<999;k++) 338 | for(long l = 0;l<99999;l++) 339 | d=(4000*8)/56*0.4; 340 | } 341 | b=!b; 342 | } 343 | } 344 | else 345 | break; 346 | } 347 | //prc(0xBF,(screen_x-olu_pixel-ux)/2,(screen_y-uy)/2,ux,uy); //yarım temizleme 348 | prc(0xBF,0,0,screen_x,screen_y); 349 | int ux2 = 650; 350 | int uy2 = 100;int uy2arti = 80; 351 | 352 | for(long k=0;k<5000;k++) 353 | for(long l = 0;l<99999;l++) 354 | d=(4000*8)/56*0.4; 355 | 356 | 357 | print(0x30,(screen_x-olu_pixel/2-ux2+br)/2-15,(screen_y-uy2+br)/3+uy2arti,"ACCESS GRANTED", 5); 358 | for(int jj=0;jj<1;jj++){//6 359 | prc(0x30,(screen_x-olu_pixel/2-ux2)/2,(screen_y-uy2)/2+uy2arti,ux2-olu_pixel/2,uy2-olu_pixel/5); 360 | prc(0xBF,(screen_x-olu_pixel/2-ux2+br)/2,(screen_y-uy2+br)/2+uy2arti,ux2-olu_pixel/2-br,uy2-br-olu_pixel/5);//arka plan 361 | 362 | for(int i=0;i0){ 461 | focus--; 462 | break; 463 | } 464 | else if(ch=='S'&&focus<3){ 465 | focus++; 466 | break; 467 | } 468 | else if(ch=='E'){ 469 | if(focus==3){ 470 | logoutmessage(); 471 | break; 472 | } 473 | } 474 | else if(ch=='L'){ 475 | outb(0x64, 0xFE); 476 | } 477 | } 478 | } 479 | 480 | return 0; 481 | } 482 | 483 | 484 | -------------------------------------------------------------------------------- /winsis/qwerty.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | qwerty.c 3 | Copyright (C) 2021 Yusuf K. Hanoğlu 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; version 2 7 | of the License. 8 | This program is distributed in the hope that it will be useful, 9 | but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | GNU General Public License for more details. 12 | You should have received a copy of the GNU General Public License 13 | along with this program; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 15 | */ 16 | 17 | 18 | #include 19 | 20 | 21 | bool charpixel[45][256] = { 22 | {0,0,0,0,0,0,0,0,0,0,0,0, 23 | 0,0,0,0,0,0,0,0,0,0,0,0, 24 | 0,0,0,0,0,1,1,0,0,0,0,0, 25 | 0,0,0,0,1,0,0,1,0,0,0,0, 26 | 0,0,0,0,1,0,0,1,0,0,0,0, 27 | 0,0,0,1,0,0,0,0,1,0,0,0, 28 | 0,0,0,1,1,1,1,1,1,0,0,0, 29 | 0,0,1,0,0,0,0,0,0,1,0,0,//A 30 | 0,0,1,0,0,0,0,0,0,1,0,0, 31 | 0,0,1,0,0,0,0,0,0,1,0,0, 32 | 0,0,0,0,0,0,0,0,0,0,0,0, 33 | 0,0,0,0,0,0,0,0,0,0,0,0,}, 34 | {0,0,0,0,0,0,0,0,0,0,0,0, 35 | 0,0,0,0,0,0,0,0,0,0,0,0, 36 | 0,0,1,1,1,1,1,1,1,0,0,0, 37 | 0,0,1,0,0,0,0,0,0,1,0,0, 38 | 0,0,1,0,0,0,0,0,0,1,0,0, 39 | 0,0,1,1,1,1,1,1,1,0,0,0,//B 40 | 0,0,1,0,0,0,0,0,0,1,0,0, 41 | 0,0,1,0,0,0,0,0,0,1,0,0, 42 | 0,0,1,0,0,0,0,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0,0,0,0, 428 | 0,0,0,0,0,0,0,0,0,0,0,0, 429 | 0,0,0,0,0,0,0,0,0,0,0,0, 430 | 0,0,0,0,0,0,0,0,0,0,0,0, 431 | 0,0,0,0,0,0,0,0,0,0,0,0,} 432 | 433 | }; 434 | int getkey() 435 | { 436 | while(true) 437 | { 438 | 439 | if(inb(0x64) & 0x1) 440 | { 441 | //println(i2cc(inb(0x60))); 442 | switch(inb(0x60)) 443 | { 444 | 445 | case 1: 446 | 447 | break; 448 | 449 | 450 | case 2: 451 | return '1'; 452 | break; 453 | case 3: 454 | return '2'; 455 | break; 456 | case 4: 457 | return '3'; 458 | break; 459 | case 5: 460 | return '4'; 461 | break; 462 | case 6: 463 | return '5'; 464 | break; 465 | case 7: 466 | return '6'; 467 | break; 468 | case 8: 469 | return '7'; 470 | break; 471 | case 9: 472 | return '8'; 473 | break; 474 | case 10: 475 | return '9'; 476 | break; 477 | case 11: 478 | return '0'; 479 | break; 480 | case 12: 481 | return '-'; 482 | break; 483 | case 13: 484 | return '='; 485 | break; 486 | case 14: 487 | return -9;//backspace 488 | break; 489 | case 15: 490 | return -10;//tab 491 | break; 492 | case 16: 493 | return 'Q'; 494 | break; 495 | case 17: 496 | return 'W'; 497 | break; 498 | case 18: 499 | return 'E'; 500 | break; 501 | case 19: 502 | return 'R'; 503 | break; 504 | case 20: 505 | return 'T'; 506 | break; 507 | case 21: 508 | return 'Y'; 509 | break; 510 | case 22: 511 | return 'U'; 512 | break; 513 | case 23: 514 | return 'I'; 515 | break; 516 | case 24: 517 | return 'O'; 518 | break; 519 | case 25: 520 | return 'P'; 521 | break; 522 | case 26: 523 | return 'Ğ'; 524 | break; 525 | case 27: 526 | return 'Ü'; 527 | break; 528 | case 28: 529 | return -100;//enter 530 | break; 531 | case 29: 532 | return -101; // Left Control 533 | break; 534 | case 30: 535 | return 'A'; 536 | break; 537 | case 31: 538 | return 'S'; 539 | break; 540 | case 32: 541 | return 'D'; 542 | break; 543 | case 33: 544 | return 'F'; 545 | break; 546 | case 34: 547 | return 'G'; 548 | break; 549 | case 35: 550 | return 'H'; 551 | break; 552 | case 36: 553 | return 'J'; 554 | break; 555 | case 37: 556 | return 'K'; 557 | break; 558 | case 38: 559 | return 'L'; 560 | break; 561 | case 39: 562 | return 'Ş'; 563 | break; 564 | case 40: 565 | return 'İ'; 566 | break; 567 | case 41: 568 | return (','); // Back tick (`) 569 | break; 570 | case 42: // Left shift 571 | return -102; 572 | break; 573 | case 43: //\ (< for somekeyboards) 574 | return '<'; 575 | break; 576 | case 44: 577 | return 'Z'; 578 | break; 579 | case 45: 580 | return 'X'; 581 | break; 582 | case 46: 583 | return 'C'; 584 | break; 585 | case 47: 586 | return 'V'; 587 | break; 588 | case 48: 589 | return 'B'; 590 | break; 591 | case 49: 592 | return 'N'; 593 | break; 594 | case 50: 595 | return 'M'; 596 | break; 597 | case 51: 598 | return 'Ö'; 599 | break; 600 | case 52: 601 | return 'Ç'; 602 | break; 603 | case 53: 604 | return '.'; 605 | break; 606 | case 54: 607 | //print('.'); 608 | return 0; 609 | break; 610 | case 55: 611 | return 0; 612 | break; 613 | case 56: 614 | return -104; // Right shift 615 | break; 616 | case 57: 617 | return ' '; 618 | break; 619 | 620 | } 621 | } 622 | } 623 | 624 | return 0; 625 | 626 | 627 | } 628 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | --------------------------------------------------------------------------------