diff --git a/kernel/trunk/blkdev/flp_drv.inc b/kernel/trunk/blkdev/flp_drv.inc index 24efb5a8c..8b97f3ce6 100644 --- a/kernel/trunk/blkdev/flp_drv.inc +++ b/kernel/trunk/blkdev/flp_drv.inc @@ -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 diff --git a/kernel/trunk/build.bat b/kernel/trunk/build.bat index c9adb2de5..0eece5a04 100644 --- a/kernel/trunk/build.bat +++ b/kernel/trunk/build.bat @@ -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%' ... diff --git a/kernel/trunk/detect/dev_fd.inc b/kernel/trunk/detect/dev_fd.inc deleted file mode 100644 index 57b20c329..000000000 --- a/kernel/trunk/detect/dev_fd.inc +++ /dev/null @@ -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 -@@: - diff --git a/kernel/trunk/detect/disks.inc b/kernel/trunk/detect/disks.inc deleted file mode 100644 index a2b4eb934..000000000 --- a/kernel/trunk/detect/disks.inc +++ /dev/null @@ -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' - diff --git a/kernel/trunk/detect/init_ata.inc b/kernel/trunk/detect/init_ata.inc index 40a51cb90..b2a8c9e07 100644 --- a/kernel/trunk/detect/init_ata.inc +++ b/kernel/trunk/detect/init_ata.inc @@ -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 ;----------------------------------------------------------------------------- @@ -46,7 +53,6 @@ align 4 pop eax @@: DEBUGF 1, 'K : BAR0 IDE base addr %x\n', dx - mov [StandardATABases], dx mov [ecx+IDE_DATA.BAR0_val], dx ;-------------------------------------- mov dx, 0x3F4 @@ -73,7 +79,6 @@ align 4 pop eax @@: DEBUGF 1, 'K : BAR2 IDE base addr %x\n', dx - mov [StandardATABases+2], dx mov [ecx+IDE_DATA.BAR2_val], dx ;-------------------------------------- mov dx, 0x374 diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index d0c22c043..fb0722b5e 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -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 ;-----------------------------------------------------------------------------