Compare commits

...

1 Commits

6 changed files with 33 additions and 64 deletions

View File

@ -12,13 +12,6 @@
; Source code author - Kulakov Vladimir Gennadievich. ; Source code author - Kulakov Vladimir Gennadievich.
; Adaptation and improvement - Mario79. ; 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: take_data_from_application_1:
mov edi, FDD_BUFF;FDD_DataBuffer ;0x40000 mov edi, FDD_BUFF;FDD_DataBuffer ;0x40000
mov ecx, 128 mov ecx, 128
@ -717,18 +710,38 @@ endg
; This function is called in boot process. ; This function is called in boot process.
; It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives. ; It creates filesystems /fd and/or /fd2, if the system has one/two floppy drives.
proc floppy_init 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 mov ecx, floppy_mutex
call mutex_init call mutex_init
; First floppy is present if [DRIVE_DATA] and 0xF0 is nonzero. ; First floppy is present if [esp] and 0xF0 is nonzero.
test byte [DRIVE_DATA], 0xF0 test byte [esp], 0xF0
jz .no1 jz .no1
stdcall disk_add, floppy_functions, floppy1_name, 1, DISK_NO_INSERT_NOTIFICATION stdcall disk_add, floppy_functions, floppy1_name, 1, DISK_NO_INSERT_NOTIFICATION
.no1: .no1:
; Second floppy is present if [DRIVE_DATA] and 0x0F is nonzero. ; Second floppy is present if [esp] and 0x0F is nonzero.
test byte [DRIVE_DATA], 0x0F test byte [esp], 0x0F
jz .no2 jz .no2
stdcall disk_add, floppy_functions, floppy2_name, 2, DISK_NO_INSERT_NOTIFICATION stdcall disk_add, floppy_functions, floppy2_name, 2, DISK_NO_INSERT_NOTIFICATION
.no2: .no2:
add esp, 4
.no_fdd:
ret ret
endp endp

View File

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

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'

View File

@ -6,6 +6,13 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; clear the DRIVE_DATA table
; author - Mario79
xor eax, eax
mov edi, DRIVE_DATA
mov ecx, DRIVE_DATA_SIZE/4
cld
rep stosd
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
; find the IDE controller in the device list ; find the IDE controller in the device list
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
@ -46,7 +53,6 @@ align 4
pop eax pop eax
@@: @@:
DEBUGF 1, 'K : BAR0 IDE base addr %x\n', dx DEBUGF 1, 'K : BAR0 IDE base addr %x\n', dx
mov [StandardATABases], dx
mov [ecx+IDE_DATA.BAR0_val], dx mov [ecx+IDE_DATA.BAR0_val], dx
;-------------------------------------- ;--------------------------------------
mov dx, 0x3F4 mov dx, 0x3F4
@ -73,7 +79,6 @@ align 4
pop eax pop eax
@@: @@:
DEBUGF 1, 'K : BAR2 IDE base addr %x\n', dx DEBUGF 1, 'K : BAR2 IDE base addr %x\n', dx
mov [StandardATABases+2], dx
mov [ecx+IDE_DATA.BAR2_val], dx mov [ecx+IDE_DATA.BAR2_val], dx
;-------------------------------------- ;--------------------------------------
mov dx, 0x374 mov dx, 0x374

View File

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