Compare commits

...

2 Commits

Author SHA1 Message Date
fdac11e922 Krn: The IDE controller initialization code has been rewritten.
This commit is not compiled!!!
2024-10-19 02:18:22 +05:00
1aa272b2e9 Krn: The fdd driver code has been cleared and unused files have been deleted 2024-06-10 02:21:11 +05:00
7 changed files with 716 additions and 428 deletions

View File

@ -12,13 +12,6 @@
; Source code author - Kulakov Vladimir Gennadievich.
; Adaptation and improvement - Mario79.
give_back_application_data_1:
mov esi, FDD_BUFF;FDD_DataBuffer ;0x40000
mov ecx, 128
cld
rep movsd
ret
take_data_from_application_1:
mov edi, FDD_BUFF;FDD_DataBuffer ;0x40000
mov ecx, 128
@ -717,18 +710,38 @@ endg
; This function is called in boot process.
; It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives.
proc floppy_init
; search for FDDs and add them to the list of disks
; author - Mario79
mov al, 0x10
out 0x70, al
mov cx, 0xff
.wait_cmos:
dec cx
test cx, cx
jnz .wait_cmos
in al, 0x71
test al, al
jz .no_fdd
push eax ; b[esp]=al [esp+1..3]- ??
stdcall attach_int_handler, 6, FDCInterrupt, 0
DEBUGF 1, "K : Set Floppy IRQ6 return code %x\n", eax
mov ecx, floppy_mutex
call mutex_init
; First floppy is present if [DRIVE_DATA] and 0xF0 is nonzero.
test byte [DRIVE_DATA], 0xF0
; First floppy is present if [esp] and 0xF0 is nonzero.
test byte [esp], 0xF0
jz .no1
stdcall disk_add, floppy_functions, floppy1_name, 1, DISK_NO_INSERT_NOTIFICATION
.no1:
; Second floppy is present if [DRIVE_DATA] and 0x0F is nonzero.
test byte [DRIVE_DATA], 0x0F
; Second floppy is present if [esp] and 0x0F is nonzero.
test byte [esp], 0x0F
jz .no2
stdcall disk_add, floppy_functions, floppy2_name, 2, DISK_NO_INSERT_NOTIFICATION
.no2:
add esp, 4
.no_fdd:
ret
endp

View File

@ -12,7 +12,7 @@ goto :eof
:Target_kernel
rem valid languages: en ru ge et sp
set lang=en
set lang=en_US
echo *** building kernel with language '%lang%' ...

View File

@ -851,37 +851,6 @@ struct PCIDEV
owner dd ? ; pointer to SRV or 0
ends
struct IDE_DATA
ProgrammingInterface dd ?
Interrupt dw ?
RegsBaseAddres dw ?
BAR0_val dw ?
BAR1_val dw ?
BAR2_val dw ?
BAR3_val dw ?
dma_hdd_channel_1 db ?
dma_hdd_channel_2 db ?
pcidev dd ? ; pointer to corresponding PCIDEV structure
ends
struct IDE_CACHE
pointer dd ?
size dd ? ; not use
data_pointer dd ?
system_data_size dd ? ; not use
appl_data_size dd ? ; not use
system_data dd ?
appl_data dd ?
system_sad_size dd ?
appl_sad_size dd ?
search_start dd ?
appl_search_start dd ?
ends
struct IDE_DEVICE
UDMA_possible_modes db ?
UDMA_set_mode db ?
ends
; The following macro assume that we are on uniprocessor machine.
; Serious work is needed for multiprocessor machines.

View File

@ -1,36 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;***************************************************
; clear the DRIVE_DATA table,
; search for FDDs and add them into the table
; author - Mario79
;***************************************************
xor eax, eax
mov edi, DRIVE_DATA
mov ecx, DRIVE_DATA_SIZE/4
cld
rep stosd
mov al, 0x10
out 0x70, al
mov cx, 0xff
wait_cmos:
dec cx
test cx, cx
jnz wait_cmos
in al, 0x71
mov [DRIVE_DATA], al
test al, al
jz @f
stdcall attach_int_handler, 6, FDCInterrupt, 0
DEBUGF 1, "K : Set IDE IRQ6 return code %x\n", eax
call floppy_init
@@:

View File

@ -1,13 +0,0 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2024. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
include 'dev_fd.inc'
include 'dev_hdcd.inc'
include 'getcache.inc'
include 'sear_par.inc'

File diff suppressed because it is too large Load Diff

View File

@ -729,7 +729,7 @@ end if
;-----------------------------------------------------------------------------
mov esi, boot_detectfloppy
call boot_log
include 'detect/dev_fd.inc'
call floppy_init
;-----------------------------------------------------------------------------
; create pci-devices list
;-----------------------------------------------------------------------------