==================================================== Mainly changed: FS.Initrd + (kind of) refractored VFS, bugfixed + Rewrote 'initrd' file system, fixed many problems + Working 'cat' and 'dir' console commands + Wrote 'initrd' image write application (for windows), however it may be bugged
		
			
				
	
	
		
			218 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			NASM
		
	
	
	
	
	
			
		
		
	
	
			218 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			NASM
		
	
	
	
	
	
| bits 32
 | |
| 
 | |
| ; !!!  ISRs  !!!
 | |
| global isr_exception_0
 | |
| global isr_exception_1
 | |
| global isr_exception_2
 | |
| global isr_exception_3
 | |
| global isr_exception_4
 | |
| global isr_exception_5
 | |
| global isr_exception_6
 | |
| global isr_exception_7
 | |
| global isr_exception_8
 | |
| global isr_exception_9
 | |
| global isr_exception_10
 | |
| global isr_exception_11
 | |
| global isr_exception_12
 | |
| global isr_exception_13
 | |
| global isr_exception_14
 | |
| global isr_exception_15
 | |
| global isr_exception_16
 | |
| global isr_exception_17
 | |
| global isr_exception_18
 | |
| global isr_exception_19
 | |
| global isr_exception_20
 | |
| global isr_exception_21
 | |
| global isr_exception_22
 | |
| global isr_exception_23
 | |
| global isr_exception_24
 | |
| global isr_exception_25
 | |
| global isr_exception_26
 | |
| global isr_exception_27
 | |
| global isr_exception_28
 | |
| global isr_exception_29
 | |
| global isr_exception_30
 | |
| global isr_exception_31
 | |
| 
 | |
| isr_exception_0:
 | |
|       cli
 | |
|       push dword 0; A normal ISR stub that pops a dummy error code to keep a
 | |
|                    ; uniform stack frame
 | |
|       push dword 0
 | |
|       jmp isr_common_stub
 | |
| isr_exception_1:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 1
 | |
|       jmp isr_common_stub
 | |
| isr_exception_2:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 2
 | |
|       jmp isr_common_stub
 | |
| isr_exception_3:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 3
 | |
|       jmp isr_common_stub
 | |
| isr_exception_4:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 4
 | |
|       jmp isr_common_stub
 | |
| isr_exception_5:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 5
 | |
|       jmp isr_common_stub
 | |
| isr_exception_6:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 6
 | |
|       jmp isr_common_stub
 | |
| isr_exception_7:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 7
 | |
|       jmp isr_common_stub
 | |
| isr_exception_8:
 | |
|       cli
 | |
|       push dword 8
 | |
|       jmp isr_common_stub
 | |
| isr_exception_9:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 9
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_10:
 | |
|       cli
 | |
|       push dword 10
 | |
|       jmp isr_common_stub
 | |
| isr_exception_11:
 | |
|       cli
 | |
|       push dword 11
 | |
|       jmp isr_common_stub
 | |
| isr_exception_12:
 | |
|       cli
 | |
|       push dword 12
 | |
|       jmp isr_common_stub
 | |
| isr_exception_13:
 | |
|       cli
 | |
|       push dword 13
 | |
|       jmp isr_common_stub
 | |
| isr_exception_14:
 | |
|       cli
 | |
|       push dword 14
 | |
|       jmp isr_common_stub
 | |
| isr_exception_15:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 15
 | |
|       jmp isr_common_stub
 | |
| isr_exception_16:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 16
 | |
|       jmp isr_common_stub
 | |
| isr_exception_17:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 17
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_18:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 18
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_19:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 19
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_20:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 20
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_21:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 21
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_22:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 22
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_23:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 23
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_24:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 24
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_25:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 25
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_26:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 26
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_27:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 27
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_28:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 28
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_29:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 29
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_30:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 30
 | |
|       jmp isr_common_stub      
 | |
| isr_exception_31:
 | |
|       cli
 | |
|       push dword 0
 | |
|       push dword 31
 | |
|       jmp isr_common_stub      
 | |
|             
 | |
| extern IsrsFaultHandler
 | |
| 
 | |
| isr_common_stub:
 | |
|     pusha
 | |
|     push ds
 | |
|     push es
 | |
|     push fs
 | |
|     push gs
 | |
|     mov ax, 0x10   ; Load the Kernel Data Segment descriptor!
 | |
|     mov ds, ax
 | |
|     mov es, ax
 | |
|     mov fs, ax
 | |
|     mov gs, ax
 | |
|     mov eax, esp   ; Push us the stack
 | |
|     push eax
 | |
|     mov eax, IsrsFaultHandler
 | |
|     call eax       ; A special call, preserves the 'eip' register
 | |
|     pop eax
 | |
|     pop gs
 | |
|     pop fs
 | |
|     pop es
 | |
|     pop ds
 | |
|     popa
 | |
|     add esp, 8     ; Cleans up the pushed error code and pushed ISR number
 | |
|     iret           ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP!
 |