forked from KolibriOS/kolibrios
I'm not sure what all my change is right.
Some optimization. git-svn-id: svn://kolibrios.org@1276 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
b81d03be4e
commit
7ac27a2f61
@ -12,7 +12,7 @@ $Revision$
|
|||||||
; Непосредственная работа с устройством СD (ATAPI)
|
; Непосредственная работа с устройством СD (ATAPI)
|
||||||
;**********************************************************
|
;**********************************************************
|
||||||
; Автор части исходного текста Кулаков Владимир Геннадьевич
|
; Автор части исходного текста Кулаков Владимир Геннадьевич
|
||||||
; Àäàïòàöèÿ, äîðàáîòêà è ðàçðàáîòêà Mario79
|
; Àäàïòàöèÿ, äîðàáîòêà è ðàçðàáîòêà Mario79,<Lrz>
|
||||||
|
|
||||||
; Максимальное количество повторений операции чтения
|
; Максимальное количество повторений операции чтения
|
||||||
MaxRetr equ 10
|
MaxRetr equ 10
|
||||||
@ -20,46 +20,7 @@ MaxRetr equ 10
|
|||||||
; (в тиках)
|
; (в тиках)
|
||||||
BSYWaitTime equ 1000 ;2
|
BSYWaitTime equ 1000 ;2
|
||||||
NoTickWaitTime equ 0xfffff
|
NoTickWaitTime equ 0xfffff
|
||||||
|
CDBlockSize equ 2048
|
||||||
;*************************************************
|
|
||||||
;* ÏÎËÍÎÅ ×ÒÅÍÈÅ ÑÅÊÒÎÐÀ ÊÎÌÏÀÊÒ-ÄÈÑÊÀ *
|
|
||||||
;* Ñ÷èòûâàþòñÿ äàííûå ïîëüçîâàòåëÿ, èíôîðìàöèÿ *
|
|
||||||
;* ñóáêàíàëà è êîíòðîëüíàÿ èíôîðìàöèÿ *
|
|
||||||
;* Âõîäíûå ïàðàìåòðû ïåðåäàþòñÿ ÷åðåç ãëîáàëüíûå *
|
|
||||||
;* ïåðìåííûå: *
|
|
||||||
;* ChannelNumber - íîìåð êàíàëà; *
|
|
||||||
;* DiskNumber - íîìåð äèñêà íà êàíàëå; *
|
|
||||||
;* CDSectorAddress - àäðåñ ñ÷èòûâàåìîãî ñåêòîðà. *
|
|
||||||
;* Äàííûå ñ÷èòûâàåòñÿ â ìàññèâ CDDataBuf. *
|
|
||||||
;*************************************************
|
|
||||||
ReadCD:
|
|
||||||
pusha
|
|
||||||
; Çàäàòü ðàçìåð ñåêòîðà
|
|
||||||
mov [CDBlockSize],2048 ;2352
|
|
||||||
; Î÷èñòèòü áóôåð ïàêåòíîé êîìàíäû
|
|
||||||
call clear_packet_buffer
|
|
||||||
; Ñôîðìèðîâàòü ïàêåòíóþ êîìàíäó äëÿ ñ÷èòûâàíèÿ
|
|
||||||
; ñåêòîðà äàííûõ
|
|
||||||
; Çàäàòü êîä êîìàíäû Read CD
|
|
||||||
mov [PacketCommand],byte 0x28 ;0xBE
|
|
||||||
; Çàäàòü àäðåñ ñåêòîðà
|
|
||||||
mov AX,word [CDSectorAddress+2]
|
|
||||||
xchg AL,AH
|
|
||||||
mov word [PacketCommand+2],AX
|
|
||||||
mov AX,word [CDSectorAddress]
|
|
||||||
xchg AL,AH
|
|
||||||
mov word [PacketCommand+4],AX
|
|
||||||
; mov eax,[CDSectorAddress]
|
|
||||||
; mov [PacketCommand+2],eax
|
|
||||||
; Çàäàòü êîëè÷åñòâî ñ÷èòûâàåìûõ ñåêòîðîâ
|
|
||||||
mov [PacketCommand+8],byte 1
|
|
||||||
; Çàäàòü ñ÷èòûâàíèå äàííûõ â ïîëíîì îáúåìå
|
|
||||||
; mov [PacketCommand+9],byte 0xF8
|
|
||||||
; Ïîäàòü êîìàíäó
|
|
||||||
call SendPacketDatCommand
|
|
||||||
popa
|
|
||||||
ret
|
|
||||||
|
|
||||||
;********************************************
|
;********************************************
|
||||||
;* ЧТЕНИЕ СЕКТОРА С ПОВТОРАМИ *
|
;* ЧТЕНИЕ СЕКТОРА С ПОВТОРАМИ *
|
||||||
;* Многократное повторение чтения при сбоях *
|
;* Многократное повторение чтения при сбоях *
|
||||||
@ -73,8 +34,9 @@ ReadCDWRetr:
|
|||||||
mov eax,[CDSectorAddress]
|
mov eax,[CDSectorAddress]
|
||||||
mov ebx,[CDDataBuf_pointer]
|
mov ebx,[CDDataBuf_pointer]
|
||||||
call cd_calculate_cache
|
call cd_calculate_cache
|
||||||
|
xor edi,edi
|
||||||
add esi,8
|
add esi,8
|
||||||
mov edi,1
|
inc edi
|
||||||
.hdreadcache:
|
.hdreadcache:
|
||||||
; cmp dword [esi+4],0 ; empty
|
; cmp dword [esi+4],0 ; empty
|
||||||
; je .nohdcache
|
; je .nohdcache
|
||||||
@ -128,9 +90,49 @@ ReadCDWRetr_1:
|
|||||||
mov ECX,MaxRetr
|
mov ECX,MaxRetr
|
||||||
@@NextRetr:
|
@@NextRetr:
|
||||||
; Подать команду
|
; Подать команду
|
||||||
call ReadCD
|
;*************************************************
|
||||||
cmp [DevErrorCode],0
|
;* ÏÎËÍÎÅ ×ÒÅÍÈÅ ÑÅÊÒÎÐÀ ÊÎÌÏÀÊÒ-ÄÈÑÊÀ *
|
||||||
je @@End_4
|
;* Ñ÷èòûâàþòñÿ äàííûå ïîëüçîâàòåëÿ, èíôîðìàöèÿ *
|
||||||
|
;* ñóáêàíàëà è êîíòðîëüíàÿ èíôîðìàöèÿ *
|
||||||
|
;* Âõîäíûå ïàðàìåòðû ïåðåäàþòñÿ ÷åðåç ãëîáàëüíûå *
|
||||||
|
;* ïåðìåííûå: *
|
||||||
|
;* ChannelNumber - íîìåð êàíàëà; *
|
||||||
|
;* DiskNumber - íîìåð äèñêà íà êàíàëå; *
|
||||||
|
;* CDSectorAddress - àäðåñ ñ÷èòûâàåìîãî ñåêòîðà. *
|
||||||
|
;* Äàííûå ñ÷èòûâàåòñÿ â ìàññèâ CDDataBuf. *
|
||||||
|
;*************************************************
|
||||||
|
;ReadCD:
|
||||||
|
push ecx
|
||||||
|
; pusha
|
||||||
|
; Çàäàòü ðàçìåð ñåêòîðà
|
||||||
|
; mov [CDBlockSize],2048 ;2352
|
||||||
|
; Î÷èñòèòü áóôåð ïàêåòíîé êîìàíäû
|
||||||
|
call clear_packet_buffer
|
||||||
|
; Ñôîðìèðîâàòü ïàêåòíóþ êîìàíäó äëÿ ñ÷èòûâàíèÿ
|
||||||
|
; ñåêòîðà äàííûõ
|
||||||
|
; Çàäàòü êîä êîìàíäû Read CD
|
||||||
|
mov [PacketCommand],byte 0x28 ;0xBE
|
||||||
|
; Çàäàòü àäðåñ ñåêòîðà
|
||||||
|
mov AX,word [CDSectorAddress+2]
|
||||||
|
xchg AL,AH
|
||||||
|
mov word [PacketCommand+2],AX
|
||||||
|
mov AX,word [CDSectorAddress]
|
||||||
|
xchg AL,AH
|
||||||
|
mov word [PacketCommand+4],AX
|
||||||
|
; mov eax,[CDSectorAddress]
|
||||||
|
; mov [PacketCommand+2],eax
|
||||||
|
; Çàäàòü êîëè÷åñòâî ñ÷èòûâàåìûõ ñåêòîðîâ
|
||||||
|
mov [PacketCommand+8],byte 1
|
||||||
|
; Çàäàòü ñ÷èòûâàíèå äàííûõ â ïîëíîì îáúåìå
|
||||||
|
; mov [PacketCommand+9],byte 0xF8
|
||||||
|
; Ïîäàòü êîìàíäó
|
||||||
|
call SendPacketDatCommand
|
||||||
|
pop ecx
|
||||||
|
; ret
|
||||||
|
|
||||||
|
; cmp [DevErrorCode],0
|
||||||
|
test eax,eax
|
||||||
|
jz @@End_4
|
||||||
|
|
||||||
or ecx,ecx ;{SPraid.simba} (for cd load)
|
or ecx,ecx ;{SPraid.simba} (for cd load)
|
||||||
jz @@End_4
|
jz @@End_4
|
||||||
@ -141,8 +143,8 @@ ReadCDWRetr_1:
|
|||||||
mov eax,NoTickWaitTime
|
mov eax,NoTickWaitTime
|
||||||
.wait:
|
.wait:
|
||||||
dec eax
|
dec eax
|
||||||
cmp eax,0
|
; test eax,eax
|
||||||
je @@NextRetr
|
jz @@NextRetr
|
||||||
jmp .wait
|
jmp .wait
|
||||||
@@:
|
@@:
|
||||||
; Задержка на 2,5 секунды
|
; Задержка на 2,5 секунды
|
||||||
@ -154,23 +156,25 @@ ReadCDWRetr_1:
|
|||||||
; ja @@Wait
|
; ja @@Wait
|
||||||
loop @@NextRetr
|
loop @@NextRetr
|
||||||
@@End_4:
|
@@End_4:
|
||||||
|
mov dword [DevErrorCode],eax
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
; Óíèâåðñàëüíûå ïðîöåäóðû, îáåñïå÷èâàþùèå âûïîëíåíèå
|
; Óíèâåðñàëüíûå ïðîöåäóðû, îáåñïå÷èâàþùèå âûïîëíåíèå
|
||||||
; пакетных команд в режиме PIO
|
; пакетных команд в режиме PIO
|
||||||
|
|
||||||
; Максимально допустимое время ожидания реакции
|
; Максимально допустимое время ожидания реакции
|
||||||
; устройства на пакетную команду (в тиках)
|
; устройства на пакетную команду (в тиках)
|
||||||
MaxCDWaitTime equ 1000 ;200 ;10 ñåêóíä
|
|
||||||
|
|
||||||
|
MaxCDWaitTime equ 1000 ;200 ;10 ñåêóíä
|
||||||
|
uglobal
|
||||||
; Область памяти для формирования пакетной команды
|
; Область памяти для формирования пакетной команды
|
||||||
PacketCommand: rb 12 ;DB 12 DUP (?)
|
PacketCommand: rb 12 ;DB 12 DUP (?)
|
||||||
; Область памяти для приема данных от дисковода
|
; Область памяти для приема данных от дисковода
|
||||||
;CDDataBuf DB 4096 DUP (0)
|
;CDDataBuf DB 4096 DUP (0)
|
||||||
; Размер принимаемого блока данных в байтах
|
; Размер принимаемого блока данных в байтах
|
||||||
CDBlockSize DW ?
|
;CDBlockSize DW ?
|
||||||
; Адрес считываемого сектора данных
|
; Адрес считываемого сектора данных
|
||||||
CDSectorAddress: DD ?
|
CDSectorAddress: DD ?
|
||||||
; Время начала очередной операции с диском
|
; Время начала очередной операции с диском
|
||||||
@ -179,7 +183,7 @@ TickCounter_1 DD 0
|
|||||||
WURStartTime DD 0
|
WURStartTime DD 0
|
||||||
; указатель буфера для считывания
|
; указатель буфера для считывания
|
||||||
CDDataBuf_pointer dd 0
|
CDDataBuf_pointer dd 0
|
||||||
|
endg
|
||||||
;****************************************************
|
;****************************************************
|
||||||
;* ПОСЛАТЬ УСТРОЙСТВУ ATAPI ПАКЕТНУЮ КОМАНДУ, *
|
;* ПОСЛАТЬ УСТРОЙСТВУ ATAPI ПАКЕТНУЮ КОМАНДУ, *
|
||||||
;* ПРЕДУСМАТРИВАЮЩУЮ ПЕРЕДАЧУ ОДНОГО СЕКТОРА ДАННЫХ *
|
;* ПРЕДУСМАТРИВАЮЩУЮ ПЕРЕДАЧУ ОДНОГО СЕКТОРА ДАННЫХ *
|
||||||
@ -190,24 +194,26 @@ CDDataBuf_pointer dd 0
|
|||||||
;* DiskNumber - номер диска на канале; *
|
;* DiskNumber - номер диска на канале; *
|
||||||
;* PacketCommand - 12-байтный командный пакет; *
|
;* PacketCommand - 12-байтный командный пакет; *
|
||||||
;* CDBlockSize - размер принимаемого блока данных. *
|
;* CDBlockSize - размер принимаемого блока данных. *
|
||||||
|
; return eax DevErrorCode
|
||||||
;****************************************************
|
;****************************************************
|
||||||
SendPacketDatCommand:
|
SendPacketDatCommand:
|
||||||
pushad
|
xor eax,eax
|
||||||
mov [DevErrorCode],0
|
; mov byte [DevErrorCode],al
|
||||||
; Задать режим CHS
|
; Задать режим CHS
|
||||||
mov [ATAAddressMode],0
|
mov byte [ATAAddressMode],al
|
||||||
; Послать ATA-команду передачи пакетной команды
|
; Послать ATA-команду передачи пакетной команды
|
||||||
mov [ATAFeatures],0
|
mov byte [ATAFeatures],al
|
||||||
mov [ATASectorCount],0
|
mov byte [ATASectorCount],al
|
||||||
mov [ATASectorNumber],0
|
mov byte [ATASectorNumber],al
|
||||||
; Загрузить размер передаваемого блока
|
; Загрузить размер передаваемого блока
|
||||||
mov AX,[CDBlockSize]
|
mov [ATAHead],al
|
||||||
mov [ATACylinder],AX
|
; mov AX,[CDBlockSize]
|
||||||
mov [ATAHead],0
|
mov [ATACylinder],CDBlockSize
|
||||||
mov [ATACommand],0A0h
|
mov [ATACommand],0A0h
|
||||||
call SendCommandToHDD_1
|
call SendCommandToHDD_1
|
||||||
cmp [DevErrorCode],0 ;ïðîâåðèòü êîä îøèáêè
|
test eax,eax
|
||||||
jne @@End_8 ;çàêîí÷èòü, ñîõðàíèâ êîä îøèáêè
|
; cmp [DevErrorCode],0 ;ïðîâåðèòü êîä îøèáêè
|
||||||
|
jnz @@End_8 ;çàêîí÷èòü, ñîõðàíèâ êîä îøèáêè
|
||||||
|
|
||||||
; Ожидание готовности дисковода к приему
|
; Ожидание готовности дисковода к приему
|
||||||
; пакетной команды
|
; пакетной команды
|
||||||
@ -218,8 +224,8 @@ SendPacketDatCommand:
|
|||||||
cmp [timer_ticks_enable],0
|
cmp [timer_ticks_enable],0
|
||||||
jne @f
|
jne @f
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; test ecx,ecx
|
||||||
je @@Err1_1
|
jz @@Err1_1
|
||||||
jmp .test
|
jmp .test
|
||||||
@@:
|
@@:
|
||||||
call change_task
|
call change_task
|
||||||
@ -261,8 +267,8 @@ SendPacketDatCommand:
|
|||||||
cmp [timer_ticks_enable],0
|
cmp [timer_ticks_enable],0
|
||||||
jne @f
|
jne @f
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; test ecx,ecx
|
||||||
je @@Err1_1
|
jz @@Err1_1
|
||||||
jmp .test_1
|
jmp .test_1
|
||||||
@@:
|
@@:
|
||||||
call change_task
|
call change_task
|
||||||
@ -286,7 +292,7 @@ SendPacketDatCommand:
|
|||||||
mov DX,[ATABasePortAddr] ;порт 1x0h
|
mov DX,[ATABasePortAddr] ;порт 1x0h
|
||||||
; Загрузить в счетчик размер блока в байтах
|
; Загрузить в счетчик размер блока в байтах
|
||||||
xor ecx,ecx
|
xor ecx,ecx
|
||||||
mov CX,[CDBlockSize]
|
mov CX,CDBlockSize
|
||||||
; Вычислить размер блока в 16-разрядных словах
|
; Вычислить размер блока в 16-разрядных словах
|
||||||
shr CX,1 ;разделить размер блока на 2
|
shr CX,1 ;разделить размер блока на 2
|
||||||
; Принять блок данных
|
; Принять блок данных
|
||||||
@ -294,21 +300,29 @@ SendPacketDatCommand:
|
|||||||
cld
|
cld
|
||||||
rep insw
|
rep insw
|
||||||
sti
|
sti
|
||||||
; Óñïåøíîå çàâåðøåíèå ïðèåìà äàííûõ
|
; Óñïåøíîå çàâåðøåíèå ïðèåìà äàííûõ
|
||||||
jmp @@End_8
|
@@End_8:
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
|
|
||||||
; Записать код ошибки
|
; Записать код ошибки
|
||||||
@@Err1_1:
|
@@Err1_1:
|
||||||
mov [DevErrorCode],1
|
xor eax,eax
|
||||||
jmp @@End_8
|
inc eax
|
||||||
|
ret
|
||||||
|
; mov [DevErrorCode],1
|
||||||
|
; ret
|
||||||
@@Err6_temp:
|
@@Err6_temp:
|
||||||
mov [DevErrorCode],7
|
mov eax,7
|
||||||
jmp @@End_8
|
ret
|
||||||
|
; mov [DevErrorCode],7
|
||||||
|
; ret
|
||||||
@@Err6:
|
@@Err6:
|
||||||
mov [DevErrorCode],6
|
mov eax,6
|
||||||
@@End_8:
|
ret
|
||||||
popad
|
; mov [DevErrorCode],6
|
||||||
ret
|
;@@End_8:
|
||||||
|
; ret
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -323,19 +337,21 @@ SendPacketDatCommand:
|
|||||||
;***********************************************
|
;***********************************************
|
||||||
SendPacketNoDatCommand:
|
SendPacketNoDatCommand:
|
||||||
pushad
|
pushad
|
||||||
mov [DevErrorCode],0
|
xor eax,eax
|
||||||
|
; mov byte [DevErrorCode],al
|
||||||
; Задать режим CHS
|
; Задать режим CHS
|
||||||
mov [ATAAddressMode],0
|
mov byte [ATAAddressMode],al
|
||||||
; Послать ATA-команду передачи пакетной команды
|
; Послать ATA-команду передачи пакетной команды
|
||||||
mov [ATAFeatures],0
|
mov byte [ATAFeatures],al
|
||||||
mov [ATASectorCount],0
|
mov byte [ATASectorCount],al
|
||||||
mov [ATASectorNumber],0
|
mov byte [ATASectorNumber],al
|
||||||
mov [ATACylinder],0
|
mov word [ATACylinder],ax
|
||||||
mov [ATAHead],0
|
mov byte [ATAHead],al
|
||||||
mov [ATACommand],0A0h
|
mov [ATACommand],0A0h
|
||||||
call SendCommandToHDD_1
|
call SendCommandToHDD_1
|
||||||
cmp [DevErrorCode],0 ;ïðîâåðèòü êîä îøèáêè
|
; cmp [DevErrorCode],0 ;ïðîâåðèòü êîä îøèáêè
|
||||||
jne @@End_9 ;çàêîí÷èòü, ñîõðàíèâ êîä îøèáêè
|
test eax,eax
|
||||||
|
jnz @@End_9 ;çàêîí÷èòü, ñîõðàíèâ êîä îøèáêè
|
||||||
; Ожидание готовности дисковода к приему
|
; Ожидание готовности дисковода к приему
|
||||||
; пакетной команды
|
; пакетной команды
|
||||||
mov DX,[ATABasePortAddr]
|
mov DX,[ATABasePortAddr]
|
||||||
@ -371,8 +387,8 @@ SendPacketNoDatCommand:
|
|||||||
mov AX,word [PacketCommand+10]
|
mov AX,word [PacketCommand+10]
|
||||||
out DX,AX
|
out DX,AX
|
||||||
; sti
|
; sti
|
||||||
cmp [ignore_CD_eject_wait],1
|
cmp [ignore_CD_eject_wait],1
|
||||||
je @@End_9
|
je @@clear_DEC
|
||||||
; Ожидание подтверждения приема команды
|
; Ожидание подтверждения приема команды
|
||||||
mov DX,[ATABasePortAddr]
|
mov DX,[ATABasePortAddr]
|
||||||
add DX,7 ;порт 1х7h
|
add DX,7 ;порт 1х7h
|
||||||
@ -391,15 +407,19 @@ SendPacketNoDatCommand:
|
|||||||
jnz @@Err6_1
|
jnz @@Err6_1
|
||||||
test AL,40h ;состояние сигнала DRDY
|
test AL,40h ;состояние сигнала DRDY
|
||||||
jz @@WaitDevice1_1
|
jz @@WaitDevice1_1
|
||||||
jmp @@End_9
|
@@clear_DEC:
|
||||||
|
and [DevErrorCode],0
|
||||||
|
popad
|
||||||
|
ret
|
||||||
; Записать код ошибки
|
; Записать код ошибки
|
||||||
@@Err1_3:
|
@@Err1_3:
|
||||||
mov [DevErrorCode],1
|
xor eax,eax
|
||||||
|
inc eax
|
||||||
jmp @@End_9
|
jmp @@End_9
|
||||||
@@Err6_1:
|
@@Err6_1:
|
||||||
mov [DevErrorCode],6
|
mov eax,6
|
||||||
@@End_9:
|
@@End_9:
|
||||||
|
mov [DevErrorCode],eax
|
||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -420,11 +440,11 @@ SendPacketNoDatCommand:
|
|||||||
;* в ATABasePortAddr - базовый адрес HDD; *
|
;* в ATABasePortAddr - базовый адрес HDD; *
|
||||||
;* в DevErrorCode - ноль. *
|
;* в DevErrorCode - ноль. *
|
||||||
;* При возникновении ошибки в DevErrorCode будет *
|
;* При возникновении ошибки в DevErrorCode будет *
|
||||||
;* âîçâðàùåí êîä îøèáêè. *
|
;* âîçâðàùåí êîä îøèáêè â eax *
|
||||||
;****************************************************
|
;****************************************************
|
||||||
SendCommandToHDD_1:
|
SendCommandToHDD_1:
|
||||||
pushad
|
; pushad
|
||||||
mov [DevErrorCode],0
|
; mov [DevErrorCode],0 not need
|
||||||
; Проверить значение кода режима
|
; Проверить значение кода режима
|
||||||
cmp [ATAAddressMode],1
|
cmp [ATAAddressMode],1
|
||||||
ja @@Err2_4
|
ja @@Err2_4
|
||||||
@ -459,8 +479,8 @@ SendCommandToHDD_1:
|
|||||||
cmp [timer_ticks_enable],0
|
cmp [timer_ticks_enable],0
|
||||||
jne @f
|
jne @f
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; test ecx,ecx
|
||||||
je @@Err1_4
|
jz @@Err1_4
|
||||||
jmp .test
|
jmp .test
|
||||||
@@:
|
@@:
|
||||||
call change_task
|
call change_task
|
||||||
@ -514,28 +534,35 @@ SendCommandToHDD_1:
|
|||||||
out DX,AL
|
out DX,AL
|
||||||
sti
|
sti
|
||||||
; Сбросить признак ошибки
|
; Сбросить признак ошибки
|
||||||
mov [DevErrorCode],0
|
; mov [DevErrorCode],0
|
||||||
jmp @@End_10
|
@@End_10:
|
||||||
|
xor eax,eax
|
||||||
|
ret
|
||||||
; Записать код ошибки
|
; Записать код ошибки
|
||||||
@@Err1_4:
|
@@Err1_4:
|
||||||
mov [DevErrorCode],1
|
xor eax,eax
|
||||||
jmp @@End_10
|
inc eax
|
||||||
|
; mov [DevErrorCode],1
|
||||||
|
ret
|
||||||
@@Err2_4:
|
@@Err2_4:
|
||||||
mov [DevErrorCode],2
|
mov eax,2
|
||||||
jmp @@End_10
|
; mov [DevErrorCode],2
|
||||||
|
ret
|
||||||
@@Err3_4:
|
@@Err3_4:
|
||||||
mov [DevErrorCode],3
|
mov eax,3
|
||||||
jmp @@End_10
|
; mov [DevErrorCode],3
|
||||||
|
ret
|
||||||
@@Err4_4:
|
@@Err4_4:
|
||||||
mov [DevErrorCode],4
|
mov eax,4
|
||||||
jmp @@End_10
|
; mov [DevErrorCode],4
|
||||||
|
ret
|
||||||
@@Err5_4:
|
@@Err5_4:
|
||||||
mov [DevErrorCode],5
|
mov eax,5
|
||||||
|
; mov [DevErrorCode],5
|
||||||
; Завершение работы программы
|
; Завершение работы программы
|
||||||
@@End_10:
|
ret
|
||||||
; sti
|
; sti
|
||||||
popad
|
; popad
|
||||||
ret
|
|
||||||
|
|
||||||
;*************************************************
|
;*************************************************
|
||||||
;* ОЖИДАНИЕ ГОТОВНОСТИ УСТРОЙСТВА К РАБОТЕ *
|
;* ОЖИДАНИЕ ГОТОВНОСТИ УСТРОЙСТВА К РАБОТЕ *
|
||||||
@ -563,8 +590,8 @@ WaitUnitReady:
|
|||||||
cmp [DevErrorCode],0
|
cmp [DevErrorCode],0
|
||||||
je @@End_11
|
je @@End_11
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; cmp ecx,0
|
||||||
je .Error
|
jz .Error
|
||||||
jmp @@SendCommand
|
jmp @@SendCommand
|
||||||
@@:
|
@@:
|
||||||
call change_task
|
call change_task
|
||||||
@ -815,14 +842,14 @@ check_ATAPI_device_event:
|
|||||||
call EjectMedium
|
call EjectMedium
|
||||||
mov [ignore_CD_eject_wait],0
|
mov [ignore_CD_eject_wait],0
|
||||||
ret
|
ret
|
||||||
|
iglobal
|
||||||
timer_ATAPI_check dd 0
|
timer_ATAPI_check dd 0
|
||||||
ATAPI_IDE0_lock db 0
|
ATAPI_IDE0_lock db 0
|
||||||
ATAPI_IDE1_lock db 0
|
ATAPI_IDE1_lock db 0
|
||||||
ATAPI_IDE2_lock db 0
|
ATAPI_IDE2_lock db 0
|
||||||
ATAPI_IDE3_lock db 0
|
ATAPI_IDE3_lock db 0
|
||||||
ignore_CD_eject_wait db 0
|
ignore_CD_eject_wait db 0
|
||||||
|
endg
|
||||||
;*************************************************
|
;*************************************************
|
||||||
;* Получить сообщение о событии или состоянии *
|
;* Получить сообщение о событии или состоянии *
|
||||||
;* устройства *
|
;* устройства *
|
||||||
@ -896,7 +923,7 @@ Read_TOC:
|
|||||||
|
|
||||||
clear_packet_buffer:
|
clear_packet_buffer:
|
||||||
; Очистить буфер пакетной команды
|
; Очистить буфер пакетной команды
|
||||||
mov [PacketCommand],dword 0
|
and [PacketCommand],dword 0
|
||||||
mov [PacketCommand+4],dword 0
|
and [PacketCommand+4],dword 0
|
||||||
mov [PacketCommand+8],dword 0
|
and [PacketCommand+8],dword 0
|
||||||
ret
|
ret
|
||||||
|
@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
$Revision$
|
$Revision$
|
||||||
|
|
||||||
|
iglobal
|
||||||
conf_path_sect: db 'path',0
|
conf_path_sect: db 'path',0
|
||||||
|
|
||||||
conf_fname db '/sys/sys.conf',0
|
conf_fname db '/sys/sys.conf',0
|
||||||
|
endg
|
||||||
; set soke kernel configuration
|
; set soke kernel configuration
|
||||||
proc set_kernel_conf
|
proc set_kernel_conf
|
||||||
locals
|
locals
|
||||||
@ -64,7 +64,7 @@ proc set_kernel_conf
|
|||||||
popad
|
popad
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
|
iglobal
|
||||||
ugui db 'gui',0
|
ugui db 'gui',0
|
||||||
ugui_mouse_speed db 'mouse_speed',0
|
ugui_mouse_speed db 'mouse_speed',0
|
||||||
ugui_mouse_speed_def db '2',0
|
ugui_mouse_speed_def db '2',0
|
||||||
@ -74,7 +74,7 @@ ugui_mouse_delay_def db '0x00A',0
|
|||||||
udev db 'dev',0
|
udev db 'dev',0
|
||||||
udev_midibase db 'midibase',0
|
udev_midibase db 'midibase',0
|
||||||
udev_midibase_def db '0x320',0
|
udev_midibase_def db '0x320',0
|
||||||
|
endg
|
||||||
;set up netvork configuration
|
;set up netvork configuration
|
||||||
proc set_network_conf
|
proc set_network_conf
|
||||||
locals
|
locals
|
||||||
@ -123,14 +123,14 @@ endl
|
|||||||
|
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
iglobal
|
||||||
unet db 'net',0
|
unet db 'net',0
|
||||||
unet_active db 'active',0
|
unet_active db 'active',0
|
||||||
unet_addr db 'addr',0
|
unet_addr db 'addr',0
|
||||||
unet_mask db 'mask',0
|
unet_mask db 'mask',0
|
||||||
unet_gate db 'gate',0
|
unet_gate db 'gate',0
|
||||||
unet_def db 0
|
unet_def db 0
|
||||||
|
endg
|
||||||
; convert string to DWord
|
; convert string to DWord
|
||||||
proc strtoint stdcall,strs
|
proc strtoint stdcall,strs
|
||||||
pushad
|
pushad
|
||||||
|
@ -986,9 +986,9 @@ sysfn_meminfo:
|
|||||||
mov [ecx+24], eax
|
mov [ecx+24], eax
|
||||||
ret
|
ret
|
||||||
.fail:
|
.fail:
|
||||||
mov dword [esp+32], -1
|
or dword [esp+32], -1
|
||||||
ret
|
ret
|
||||||
|
iglobal
|
||||||
align 4
|
align 4
|
||||||
f68call:
|
f68call:
|
||||||
dd f68.11 ; init_heap
|
dd f68.11 ; init_heap
|
||||||
@ -1006,7 +1006,7 @@ f68call:
|
|||||||
dd f68.23 ; shmem_close
|
dd f68.23 ; shmem_close
|
||||||
dd f68.24
|
dd f68.24
|
||||||
dd f68.25
|
dd f68.25
|
||||||
|
endg
|
||||||
align 4
|
align 4
|
||||||
f68:
|
f68:
|
||||||
cmp eax,4
|
cmp eax,4
|
||||||
|
@ -226,6 +226,7 @@ struc TIMER
|
|||||||
.arg dd ?
|
.arg dd ?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
MAX_PROIRITY 0 ; highest, used for kernel tasks
|
MAX_PROIRITY 0 ; highest, used for kernel tasks
|
||||||
MAX_USER_PRIORITY 0 ; highest priority for user processes
|
MAX_USER_PRIORITY 0 ; highest priority for user processes
|
||||||
USER_PRIORITY 7 ; default (should correspond to nice 0)
|
USER_PRIORITY 7 ; default (should correspond to nice 0)
|
||||||
@ -233,7 +234,9 @@ MIN_USER_PRIORITY 14 ; minimum priority for user processes
|
|||||||
IDLE_PRIORITY 15 ; lowest, only IDLE process goes here
|
IDLE_PRIORITY 15 ; lowest, only IDLE process goes here
|
||||||
NR_SCHED_QUEUES 16 ; MUST equal IDLE_PRIORYTY + 1
|
NR_SCHED_QUEUES 16 ; MUST equal IDLE_PRIORYTY + 1
|
||||||
|
|
||||||
|
uglobal
|
||||||
rdy_head rd 16
|
rdy_head rd 16
|
||||||
|
endg
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
pick_task:
|
pick_task:
|
||||||
|
@ -123,13 +123,13 @@ iglobal
|
|||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd 0
|
dd 0
|
||||||
dd sys_midi ; 20-ResetMidi and OutputMidi
|
dd 0
|
||||||
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
dd 0
|
||||||
dd sys_settime ; 22-setting date,time,clock and alarm-clock
|
dd sys_settime
|
||||||
dd 0
|
dd 0
|
||||||
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
dd syscall_cdaudio ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
||||||
dd 0 ;
|
dd 0 ; 25
|
||||||
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
dd 0 ; 26
|
||||||
dd 0
|
dd 0
|
||||||
dd 0 ;
|
dd 0 ;
|
||||||
dd 0
|
dd 0
|
||||||
@ -202,13 +202,13 @@ iglobal
|
|||||||
dd sys_getbutton ; 17-GetButton
|
dd sys_getbutton ; 17-GetButton
|
||||||
dd sys_system ; 18-System Services
|
dd sys_system ; 18-System Services
|
||||||
dd paleholder ; 19-reserved
|
dd paleholder ; 19-reserved
|
||||||
dd cross_order ; 20-ResetMidi and OutputMidi
|
dd sys_midi ; 20-ResetMidi and OutputMidi
|
||||||
dd cross_order ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
dd sys_setup ; 21-SetMidiBase,SetKeymap,SetShiftKeymap,.
|
||||||
dd cross_order ; 22-setting date,time,clock and alarm-clock
|
dd cross_order ; 22-setting date,time,clock and alarm-clock
|
||||||
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
dd sys_wait_event_timeout ; 23-TimeOutWaitForEvent
|
||||||
dd cross_order ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
dd cross_order ; 24-PlayCdTrack,StopCd and GetCdPlaylist
|
||||||
dd undefined_syscall ; 25-reserved
|
dd undefined_syscall ; 25-reserved
|
||||||
dd cross_order ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
dd sys_getsetup ; 26-GetMidiBase,GetKeymap,GetShiftKeymap,.
|
||||||
dd undefined_syscall ; 27-reserved
|
dd undefined_syscall ; 27-reserved
|
||||||
dd undefined_syscall ; 28-reserved
|
dd undefined_syscall ; 28-reserved
|
||||||
dd sys_date ; 29-GetDate
|
dd sys_date ; 29-GetDate
|
||||||
|
@ -121,26 +121,26 @@ shmem_list:
|
|||||||
|
|
||||||
; supported videomodes
|
; supported videomodes
|
||||||
|
|
||||||
mode_1280_1024_32:
|
;mode_1280_1024_32:
|
||||||
dw 1280,1024,32,60
|
; dw 1280,1024,32,60
|
||||||
mode_1280_1024_24:
|
;mode_1280_1024_24:
|
||||||
dw 1280,1024,24,60
|
; dw 1280,1024,24,60
|
||||||
mode_1024_768_32:
|
;mode_1024_768_32:
|
||||||
dw 1024,768,32,60
|
; dw 1024,768,32,60
|
||||||
mode_1024_768_24:
|
;mode_1024_768_24:
|
||||||
dw 1024,768,24,60
|
; dw 1024,768,24,60
|
||||||
mode_800_600_32:
|
;mode_800_600_32:
|
||||||
dw 800,600,32,60
|
; dw 800,600,32,60
|
||||||
mode_800_600_24:
|
;mode_800_600_24:
|
||||||
dw 800,600,24,60
|
; dw 800,600,24,60
|
||||||
mode_640_480_32:
|
;mode_640_480_32:
|
||||||
dw 640,480,32,60
|
; dw 640,480,32,60
|
||||||
mode_640_480_24:
|
;mode_640_480_24:
|
||||||
dw 640,480,24,60
|
; dw 640,480,24,60
|
||||||
mode_640_480_16:
|
;mode_640_480_16:
|
||||||
dw 640,480,16,60
|
; dw 640,480,16,60
|
||||||
mode_320_240_8:
|
;mode_320_240_8:
|
||||||
dw 320,240,8,60
|
; dw 320,240,8,60
|
||||||
|
|
||||||
; mike.dld {
|
; mike.dld {
|
||||||
db 0
|
db 0
|
||||||
|
@ -72,8 +72,9 @@ FindHDD_3:
|
|||||||
|
|
||||||
|
|
||||||
; Адрес считываемого сектора в режиме LBA
|
; Адрес считываемого сектора в режиме LBA
|
||||||
|
uglobal
|
||||||
SectorAddress DD ?
|
SectorAddress DD ?
|
||||||
|
endg
|
||||||
;*************************************************
|
;*************************************************
|
||||||
;* ЧТЕНИЕ ИДЕНТИФИКАТОРА ЖЕСТКОГО ДИСКА *
|
;* ЧТЕНИЕ ИДЕНТИФИКАТОРА ЖЕСТКОГО ДИСКА *
|
||||||
;* Входные параметры передаются через глобальные *
|
;* Входные параметры передаются через глобальные *
|
||||||
@ -99,8 +100,8 @@ ReadHDD_ID:
|
|||||||
@@WaitCompleet:
|
@@WaitCompleet:
|
||||||
; Проверить время выполнения команды
|
; Проверить время выполнения команды
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; cmp ecx,0
|
||||||
je @@Error1 ;îøèáêà òàéì-àóòà
|
jz @@Error1 ;îøèáêà òàéì-àóòà
|
||||||
; Проверить готовность
|
; Проверить готовность
|
||||||
in AL,DX
|
in AL,DX
|
||||||
test AL,80h ;состояние сигнала BSY
|
test AL,80h ;состояние сигнала BSY
|
||||||
@ -116,19 +117,21 @@ ReadHDD_ID:
|
|||||||
mov DX,[ATABasePortAddr] ;регистр данных
|
mov DX,[ATABasePortAddr] ;регистр данных
|
||||||
mov CX,256 ;число считываемых слов
|
mov CX,256 ;число считываемых слов
|
||||||
rep insw ;принять блок данных
|
rep insw ;принять блок данных
|
||||||
jmp @@End
|
ret
|
||||||
; Записать код ошибки
|
; Записать код ошибки
|
||||||
@@Error1:
|
@@Error1:
|
||||||
mov [DevErrorCode],1
|
mov [DevErrorCode],1
|
||||||
jmp @@End
|
ret
|
||||||
@@Error6:
|
@@Error6:
|
||||||
mov [DevErrorCode],6
|
mov [DevErrorCode],6
|
||||||
@@End: ret
|
@@End: ret
|
||||||
|
|
||||||
|
|
||||||
|
iglobal
|
||||||
; Стандартные базовые адреса каналов 1 и 2
|
; Стандартные базовые адреса каналов 1 и 2
|
||||||
StandardATABases DW 1F0h, 170h
|
StandardATABases DW 1F0h, 170h
|
||||||
|
endg
|
||||||
|
uglobal
|
||||||
; Номер канала
|
; Номер канала
|
||||||
ChannelNumber DW ?
|
ChannelNumber DW ?
|
||||||
; Номер диска
|
; Номер диска
|
||||||
@ -148,8 +151,8 @@ ATACommand DB ? ;
|
|||||||
; 3 - неверный номер канала, 4 - неверный номер диска,
|
; 3 - неверный номер канала, 4 - неверный номер диска,
|
||||||
; 5 - неверный номер головки, 6 - ошибка при выполнении
|
; 5 - неверный номер головки, 6 - ошибка при выполнении
|
||||||
; команды)
|
; команды)
|
||||||
DevErrorCode DB ?
|
DevErrorCode dd ?
|
||||||
|
endg
|
||||||
;****************************************************
|
;****************************************************
|
||||||
;* ПОСЛАТЬ КОМАНДУ ЗАДАННОМУ ДИСКУ *
|
;* ПОСЛАТЬ КОМАНДУ ЗАДАННОМУ ДИСКУ *
|
||||||
;* Входные параметры передаются через глобальные *
|
;* Входные параметры передаются через глобальные *
|
||||||
@ -203,8 +206,8 @@ SendCommandToHDD:
|
|||||||
@@WaitHDReady:
|
@@WaitHDReady:
|
||||||
; Проверить время ожидани
|
; Проверить время ожидани
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; cmp ecx,0
|
||||||
je @@Err1
|
jz @@Err1
|
||||||
; mov eax,[timer_ticks]
|
; mov eax,[timer_ticks]
|
||||||
; sub eax,[TickCounter_1]
|
; sub eax,[TickCounter_1]
|
||||||
; cmp eax,300 ;ожидать 300 тиков
|
; cmp eax,300 ;ожидать 300 тиков
|
||||||
@ -253,19 +256,18 @@ SendCommandToHDD:
|
|||||||
sti
|
sti
|
||||||
; Сбросить признак ошибки
|
; Сбросить признак ошибки
|
||||||
mov [DevErrorCode],0
|
mov [DevErrorCode],0
|
||||||
jmp @@End_2
|
ret
|
||||||
; Записать код ошибки
|
; Записать код ошибки
|
||||||
@@Err1: mov [DevErrorCode],1
|
@@Err1: mov [DevErrorCode],1
|
||||||
jmp @@End_2
|
ret
|
||||||
@@Err2: mov [DevErrorCode],2
|
@@Err2: mov [DevErrorCode],2
|
||||||
jmp @@End_2
|
ret
|
||||||
@@Err3: mov [DevErrorCode],3
|
@@Err3: mov [DevErrorCode],3
|
||||||
jmp @@End_2
|
ret
|
||||||
@@Err4: mov [DevErrorCode],4
|
@@Err4: mov [DevErrorCode],4
|
||||||
jmp @@End_2
|
ret
|
||||||
@@Err5: mov [DevErrorCode],5
|
@@Err5: mov [DevErrorCode],5
|
||||||
; Завершение работы программы
|
; Завершение работы программы
|
||||||
@@End_2:
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
;*************************************************
|
;*************************************************
|
||||||
@ -293,12 +295,12 @@ ReadCD_ID:
|
|||||||
; Ожидать готовность данных HDD
|
; Ожидать готовность данных HDD
|
||||||
mov DX,[ATABasePortAddr]
|
mov DX,[ATABasePortAddr]
|
||||||
add DX,7 ;порт 1х7h
|
add DX,7 ;порт 1х7h
|
||||||
mov ecx,0xffff
|
mov ecx,0xffff
|
||||||
@@WaitCompleet_1:
|
@@WaitCompleet_1:
|
||||||
; Проверить врем
|
; Проверить врем
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; cmp ecx,0
|
||||||
je @@Error1_1 ;îøèáêà òàéì-àóòà
|
jz @@Error1_1 ;îøèáêà òàéì-àóòà
|
||||||
; Проверить готовность
|
; Проверить готовность
|
||||||
in AL,DX
|
in AL,DX
|
||||||
test AL,80h ;состояние сигнала BSY
|
test AL,80h ;состояние сигнала BSY
|
||||||
@ -314,11 +316,11 @@ ReadCD_ID:
|
|||||||
mov DX,[ATABasePortAddr] ;порт 1x0h
|
mov DX,[ATABasePortAddr] ;порт 1x0h
|
||||||
mov CX,256 ;число считываемых слов
|
mov CX,256 ;число считываемых слов
|
||||||
rep insw
|
rep insw
|
||||||
jmp @@End_1
|
ret
|
||||||
; Записать код ошибки
|
; Записать код ошибки
|
||||||
@@Error1_1:
|
@@Error1_1:
|
||||||
mov [DevErrorCode],1
|
mov [DevErrorCode],1
|
||||||
jmp @@End_1
|
ret
|
||||||
@@Error6_1:
|
@@Error6_1:
|
||||||
mov [DevErrorCode],6
|
mov [DevErrorCode],6
|
||||||
@@End_1:
|
@@End_1:
|
||||||
@ -360,7 +362,7 @@ DeviceReset:
|
|||||||
@@WaitHDReady_1:
|
@@WaitHDReady_1:
|
||||||
; Проверить время ожидани
|
; Проверить время ожидани
|
||||||
dec ecx
|
dec ecx
|
||||||
cmp ecx,0
|
; cmp ecx,0
|
||||||
je @@Err1_2 ;ошибка тайм-аута
|
je @@Err1_2 ;ошибка тайм-аута
|
||||||
; Прочитать регистр состояни
|
; Прочитать регистр состояни
|
||||||
in AL,DX
|
in AL,DX
|
||||||
@ -369,15 +371,14 @@ DeviceReset:
|
|||||||
jnz @@WaitHDReady_1
|
jnz @@WaitHDReady_1
|
||||||
; Сбросить признак ошибки
|
; Сбросить признак ошибки
|
||||||
mov [DevErrorCode],0
|
mov [DevErrorCode],0
|
||||||
jmp @@End_3
|
ret
|
||||||
; Обработка ошибок
|
; Обработка ошибок
|
||||||
@@Err1_2: mov [DevErrorCode],1
|
@@Err1_2: mov [DevErrorCode],1
|
||||||
jmp @@End_3
|
ret
|
||||||
@@Err3_2: mov [DevErrorCode],3
|
@@Err3_2: mov [DevErrorCode],3
|
||||||
jmp @@End_3
|
ret
|
||||||
@@Err4_2: mov [DevErrorCode],4
|
@@Err4_2: mov [DevErrorCode],4
|
||||||
; Записать код ошибки
|
; Записать код ошибки
|
||||||
@@End_3:
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
EndFindHDD:
|
EndFindHDD:
|
||||||
|
@ -316,13 +316,13 @@ high_code:
|
|||||||
; --------------- APM ---------------------
|
; --------------- APM ---------------------
|
||||||
|
|
||||||
; init selectors
|
; init selectors
|
||||||
mov ebx, [BOOT_VAR+0x9040] ; offset of APM entry point
|
mov ebx,[BOOT_VAR+0x9040] ; offset of APM entry point
|
||||||
movzx eax, word [BOOT_VAR+0x9050] ; real-mode segment base address of
|
movzx eax,word [BOOT_VAR+0x9050] ; real-mode segment base address of
|
||||||
; protected-mode 32-bit code segment
|
; protected-mode 32-bit code segment
|
||||||
movzx ecx, word [BOOT_VAR+0x9052] ; real-mode segment base address of
|
movzx ecx,word [BOOT_VAR+0x9052] ; real-mode segment base address of
|
||||||
; protected-mode 16-bit code segment
|
; protected-mode 16-bit code segment
|
||||||
movzx edx, word [BOOT_VAR+0x9054] ; real-mode segment base address of
|
movzx edx,word [BOOT_VAR+0x9054] ; real-mode segment base address of
|
||||||
; protected-mode 16-bit data segment
|
; protected-mode 16-bit data segment
|
||||||
|
|
||||||
shl eax, 4
|
shl eax, 4
|
||||||
mov [dword apm_code_32 + 2], ax
|
mov [dword apm_code_32 + 2], ax
|
||||||
@ -345,23 +345,18 @@ high_code:
|
|||||||
mov eax, [BOOT_VAR + 0x9044] ; version & flags
|
mov eax, [BOOT_VAR + 0x9044] ; version & flags
|
||||||
mov [apm_vf], eax
|
mov [apm_vf], eax
|
||||||
; -----------------------------------------
|
; -----------------------------------------
|
||||||
; movzx eax,byte [BOOT_VAR+0x9010] ; mouse port
|
; movzx eax,byte [BOOT_VAR+0x9010] ; mouse port
|
||||||
; mov [0xF604],byte 1 ;al
|
; mov [0xF604],byte 1 ;al
|
||||||
mov al, [BOOT_VAR+0x901F] ; DMA access
|
mov al, [BOOT_VAR+0x901F] ; DMA access
|
||||||
mov [allow_dma_access], al
|
mov [allow_dma_access], al
|
||||||
movzx eax, byte [BOOT_VAR+0x9000] ; bpp
|
mov al,[BOOT_VAR+0x9000] ; bpp
|
||||||
mov [ScreenBPP],al
|
mov [ScreenBPP],al
|
||||||
|
|
||||||
mov [_display.bpp], eax
|
|
||||||
mov [_display.vrefresh], 60
|
|
||||||
|
|
||||||
movzx eax,word [BOOT_VAR+0x900A] ; X max
|
movzx eax,word [BOOT_VAR+0x900A] ; X max
|
||||||
mov [_display.width], eax
|
|
||||||
dec eax
|
dec eax
|
||||||
mov [Screen_Max_X],eax
|
mov [Screen_Max_X],eax
|
||||||
mov [screen_workarea.right],eax
|
mov [screen_workarea.right],eax
|
||||||
movzx eax,word [BOOT_VAR+0x900C] ; Y max
|
movzx eax,word [BOOT_VAR+0x900C] ; Y max
|
||||||
mov [_display.height], eax
|
|
||||||
dec eax
|
dec eax
|
||||||
mov [Screen_Max_Y],eax
|
mov [Screen_Max_Y],eax
|
||||||
mov [screen_workarea.bottom],eax
|
mov [screen_workarea.bottom],eax
|
||||||
@ -374,9 +369,8 @@ high_code:
|
|||||||
je @f
|
je @f
|
||||||
cmp [SCR_MODE],word 0x12 ; VGA 640x480
|
cmp [SCR_MODE],word 0x12 ; VGA 640x480
|
||||||
je @f
|
je @f
|
||||||
movzx eax, word[BOOT_VAR+0x9001] ; for other modes
|
mov ax,[BOOT_VAR+0x9001] ; for other modes
|
||||||
mov [BytesPerScanLine],ax
|
mov [BytesPerScanLine],ax
|
||||||
mov [_display.pitch], eax
|
|
||||||
@@:
|
@@:
|
||||||
mov esi, BOOT_VAR+0x9080
|
mov esi, BOOT_VAR+0x9080
|
||||||
movzx ecx, byte [esi-1]
|
movzx ecx, byte [esi-1]
|
||||||
@ -386,7 +380,7 @@ high_code:
|
|||||||
|
|
||||||
; GRAPHICS ADDRESSES
|
; GRAPHICS ADDRESSES
|
||||||
|
|
||||||
mov byte [BOOT_VAR+0x901e],0x0
|
and byte [BOOT_VAR+0x901e],0x0
|
||||||
mov eax,[BOOT_VAR+0x9018]
|
mov eax,[BOOT_VAR+0x9018]
|
||||||
mov [LFBAddress],eax
|
mov [LFBAddress],eax
|
||||||
|
|
||||||
@ -646,8 +640,9 @@ no_lib_load:
|
|||||||
mov edx, 0xFFFFFF
|
mov edx, 0xFFFFFF
|
||||||
mov ebx, [MEM_AMOUNT]
|
mov ebx, [MEM_AMOUNT]
|
||||||
shr ebx, 20
|
shr ebx, 20
|
||||||
mov edi, 1
|
xor edi,edi
|
||||||
mov eax, 0x00040000
|
mov eax, 0x00040000
|
||||||
|
inc edi
|
||||||
call display_number_force
|
call display_number_force
|
||||||
|
|
||||||
; BUILD SCHEDULER
|
; BUILD SCHEDULER
|
||||||
@ -725,13 +720,15 @@ no_lib_load:
|
|||||||
mov dword [SLOT_BASE+256+APPDATA.tls_base], eax
|
mov dword [SLOT_BASE+256+APPDATA.tls_base], eax
|
||||||
|
|
||||||
; task list
|
; task list
|
||||||
mov [CURRENT_TASK],dword 1
|
mov dword [TASK_DATA+TASKDATA.mem_start],eax ; process base address
|
||||||
mov [TASK_COUNT],dword 1
|
inc eax
|
||||||
|
mov dword [CURRENT_TASK],eax
|
||||||
|
mov dword [TASK_COUNT],eax
|
||||||
mov [current_slot], SLOT_BASE+256
|
mov [current_slot], SLOT_BASE+256
|
||||||
mov [TASK_BASE],dword TASK_DATA
|
mov [TASK_BASE],dword TASK_DATA
|
||||||
mov [TASK_DATA+TASKDATA.wnd_number], 1 ; on screen number
|
mov byte[TASK_DATA+TASKDATA.wnd_number],al ; on screen number
|
||||||
mov [TASK_DATA+TASKDATA.pid], 1 ; process id number
|
mov dword [TASK_DATA+TASKDATA.pid], eax ; process id number
|
||||||
mov [TASK_DATA+TASKDATA.mem_start], 0 ; process base address
|
|
||||||
|
|
||||||
call init_cursors
|
call init_cursors
|
||||||
mov eax, [def_cursor]
|
mov eax, [def_cursor]
|
||||||
@ -769,8 +766,9 @@ no_lib_load:
|
|||||||
movzx ecx, word [boot_y]
|
movzx ecx, word [boot_y]
|
||||||
add ecx, (10+17*6) shl 16 - 10 ; 'CPU frequency is '
|
add ecx, (10+17*6) shl 16 - 10 ; 'CPU frequency is '
|
||||||
mov edx, 0xFFFFFF
|
mov edx, 0xFFFFFF
|
||||||
mov edi, 1
|
xor edi,edi
|
||||||
mov eax, 0x00040000
|
mov eax, 0x00040000
|
||||||
|
inc edi
|
||||||
call display_number_force
|
call display_number_force
|
||||||
|
|
||||||
; SET VARIABLES
|
; SET VARIABLES
|
||||||
@ -864,7 +862,8 @@ first_app_found:
|
|||||||
cli
|
cli
|
||||||
|
|
||||||
;mov [TASK_COUNT],dword 2
|
;mov [TASK_COUNT],dword 2
|
||||||
mov [CURRENT_TASK],dword 1 ; set OS task fisrt
|
push 1
|
||||||
|
pop dword [CURRENT_TASK] ; set OS task fisrt
|
||||||
|
|
||||||
; SET KEYBOARD PARAMETERS
|
; SET KEYBOARD PARAMETERS
|
||||||
mov al, 0xf6 ; reset keyboard, scan enabled
|
mov al, 0xf6 ; reset keyboard, scan enabled
|
||||||
@ -991,21 +990,21 @@ align 4
|
|||||||
boot_log:
|
boot_log:
|
||||||
pushad
|
pushad
|
||||||
|
|
||||||
mov ebx,10*65536
|
mov ebx,10*65536
|
||||||
mov bx,word [boot_y]
|
mov bx,word [boot_y]
|
||||||
add [boot_y],dword 10
|
add [boot_y],dword 10
|
||||||
mov ecx,0x80ffffff ; ASCIIZ string with white color
|
mov ecx,0x80ffffff ; ASCIIZ string with white color
|
||||||
mov edx,esi
|
xor edi,edi
|
||||||
mov edi,1
|
mov edx,esi
|
||||||
call dtext
|
inc edi
|
||||||
|
call dtext
|
||||||
|
|
||||||
mov [novesachecksum],1000
|
mov [novesachecksum],1000
|
||||||
call checkVga_N13
|
call checkVga_N13
|
||||||
|
|
||||||
popad
|
popad
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
; ;
|
; ;
|
||||||
@ -1083,7 +1082,7 @@ reserve_irqs_ports:
|
|||||||
|
|
||||||
push eax
|
push eax
|
||||||
xor eax,eax
|
xor eax,eax
|
||||||
inc eax
|
inc eax
|
||||||
mov byte [irq_owner+4*0],al ;1 ; timer
|
mov byte [irq_owner+4*0],al ;1 ; timer
|
||||||
;mov [irq_owner+4*1], 1 ; keyboard
|
;mov [irq_owner+4*1], 1 ; keyboard
|
||||||
mov byte [irq_owner+4*6],al ;1 ; floppy diskette
|
mov byte [irq_owner+4*6],al ;1 ; floppy diskette
|
||||||
@ -1125,7 +1124,7 @@ reserve_irqs_ports:
|
|||||||
setirqreadports:
|
setirqreadports:
|
||||||
|
|
||||||
mov [irq12read+0],dword 0x60 + 0x01000000 ; read port 0x60 , byte
|
mov [irq12read+0],dword 0x60 + 0x01000000 ; read port 0x60 , byte
|
||||||
and dword [irq12read+4],0 ; end of port list
|
and dword [irq12read+4],0 ; end of port list
|
||||||
; mov [irq12read+4],dword 0 ; end of port list
|
; mov [irq12read+4],dword 0 ; end of port list
|
||||||
;mov [irq04read+0],dword 0x3f8 + 0x01000000 ; read port 0x3f8 , byte
|
;mov [irq04read+0],dword 0x3f8 + 0x01000000 ; read port 0x3f8 , byte
|
||||||
;mov [irq04read+4],dword 0 ; end of port list
|
;mov [irq04read+4],dword 0 ; end of port list
|
||||||
@ -1210,7 +1209,7 @@ sys_outport:
|
|||||||
|
|
||||||
mov dx,bx ; write
|
mov dx,bx ; write
|
||||||
out dx,al
|
out dx,al
|
||||||
mov [esp+36],dword 0
|
and [esp+36],dword 0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
sopl4:
|
sopl4:
|
||||||
@ -1218,7 +1217,7 @@ sys_outport:
|
|||||||
mov dx,bx ; read
|
mov dx,bx ; read
|
||||||
in al,dx
|
in al,dx
|
||||||
and eax,0xff
|
and eax,0xff
|
||||||
mov [esp+36],dword 0
|
and [esp+36],dword 0
|
||||||
mov [esp+24],eax
|
mov [esp+24],eax
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -1235,14 +1234,14 @@ display_number:
|
|||||||
; ebx = number or pointer
|
; ebx = number or pointer
|
||||||
; ecx = x shl 16 + y
|
; ecx = x shl 16 + y
|
||||||
; edx = color
|
; edx = color
|
||||||
xor edi, edi
|
xor edi, edi
|
||||||
display_number_force:
|
display_number_force:
|
||||||
push eax
|
push eax
|
||||||
and eax,0x3fffffff
|
and eax,0x3fffffff
|
||||||
cmp eax,0xffff ; length > 0 ?
|
cmp eax,0xffff ; length > 0 ?
|
||||||
pop eax
|
pop eax
|
||||||
jge cont_displ
|
jge cont_displ
|
||||||
ret
|
ret
|
||||||
cont_displ:
|
cont_displ:
|
||||||
push eax
|
push eax
|
||||||
and eax,0x3fffffff
|
and eax,0x3fffffff
|
||||||
@ -1260,22 +1259,22 @@ display_number_force:
|
|||||||
add ebp,4
|
add ebp,4
|
||||||
mov ebp,[ebp+std_application_base_address]
|
mov ebp,[ebp+std_application_base_address]
|
||||||
mov ebx,[ebx+std_application_base_address]
|
mov ebx,[ebx+std_application_base_address]
|
||||||
displnl1:
|
displnl1:
|
||||||
sub esp,64
|
sub esp,64
|
||||||
|
|
||||||
cmp ah,0 ; DECIMAL
|
test ah,ah ; DECIMAL
|
||||||
jne no_display_desnum
|
jnz no_display_desnum
|
||||||
shr eax,16
|
shr eax,16
|
||||||
and eax,0xC03f
|
and eax,0xC03f
|
||||||
; and eax,0x3f
|
; and eax,0x3f
|
||||||
push eax
|
push eax
|
||||||
and eax,0x3f
|
and eax,0x3f
|
||||||
mov edi,esp
|
mov edi,esp
|
||||||
add edi,4+64-1
|
add edi,4+64-1
|
||||||
mov ecx,eax
|
mov ecx,eax
|
||||||
mov eax,ebx
|
mov eax,ebx
|
||||||
mov ebx,10
|
mov ebx,10
|
||||||
d_desnum:
|
d_desnum:
|
||||||
xor edx,edx
|
xor edx,edx
|
||||||
call division_64_bits
|
call division_64_bits
|
||||||
div ebx
|
div ebx
|
||||||
@ -1421,154 +1420,155 @@ sys_setup:
|
|||||||
; 12 = enable pci access
|
; 12 = enable pci access
|
||||||
|
|
||||||
|
|
||||||
mov [esp+36],dword 0
|
and [esp+32],dword 0
|
||||||
cmp eax,1 ; MIDI
|
dec ebx ; MIDI
|
||||||
jnz nsyse1
|
jnz nsyse1
|
||||||
cmp ebx,0x100
|
cmp ecx,0x100
|
||||||
jb nsyse1
|
|
||||||
mov edx,65535
|
jb nsyse1
|
||||||
cmp edx,ebx
|
mov esi,65535
|
||||||
jb nsyse1
|
cmp esi,ecx
|
||||||
mov [midi_base],bx
|
|
||||||
mov word [mididp],bx
|
jb nsyse1
|
||||||
inc bx
|
mov [midi_base],cx ;bx
|
||||||
mov word [midisp],bx
|
mov word [mididp],cx ;bx
|
||||||
ret
|
inc cx ;bx
|
||||||
|
mov word [midisp],cx ;bx
|
||||||
|
ret
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
midi_base dw 0
|
midi_base dw 0
|
||||||
endg
|
endg
|
||||||
|
|
||||||
nsyse1:
|
nsyse1:
|
||||||
|
dec ebx ; KEYBOARD
|
||||||
|
jnz nsyse2
|
||||||
|
mov edi,[TASK_BASE]
|
||||||
|
add edi,[edi+TASKDATA.mem_start]
|
||||||
|
mov eax,edi
|
||||||
|
|
||||||
; cmp eax,2 ; KEYBOARD
|
dec ecx
|
||||||
sub eax,2
|
jnz kbnobase
|
||||||
jnz nsyse2
|
mov ebx,keymap
|
||||||
; cmp ebx,1
|
mov ecx,128
|
||||||
dec ebx
|
call memmove
|
||||||
jnz kbnobase
|
ret
|
||||||
mov edi,[TASK_BASE]
|
|
||||||
add ecx,[edi+TASKDATA.mem_start]
|
|
||||||
mov eax,ecx
|
|
||||||
mov ebx,keymap
|
|
||||||
mov ecx,128
|
|
||||||
call memmove
|
|
||||||
ret
|
|
||||||
kbnobase:
|
kbnobase:
|
||||||
; cmp ebx,2
|
dec ecx
|
||||||
dec ebx
|
jnz kbnoshift
|
||||||
jnz kbnoshift
|
|
||||||
mov edi,[TASK_BASE]
|
|
||||||
add ecx,[edi+TASKDATA.mem_start]
|
|
||||||
mov eax,ecx
|
|
||||||
mov ebx,keymap_shift
|
|
||||||
mov ecx,128
|
|
||||||
call memmove
|
|
||||||
ret
|
|
||||||
kbnoshift:
|
|
||||||
; cmp ebx,3
|
|
||||||
dec ebx
|
|
||||||
jnz kbnoalt
|
|
||||||
mov edi,[TASK_BASE]
|
|
||||||
add ecx,[edi+TASKDATA.mem_start]
|
|
||||||
mov eax,ecx
|
|
||||||
mov ebx,keymap_alt
|
|
||||||
mov ecx,128
|
|
||||||
call memmove
|
|
||||||
ret
|
|
||||||
kbnoalt:
|
|
||||||
; cmp ebx,9
|
|
||||||
sub ebx,6
|
|
||||||
jnz kbnocountry
|
|
||||||
mov word [keyboard],cx
|
|
||||||
ret
|
|
||||||
kbnocountry:
|
|
||||||
mov [esp+36],dword 1
|
|
||||||
ret
|
|
||||||
nsyse2:
|
|
||||||
; cmp eax,3 ; CD
|
|
||||||
dec eax
|
|
||||||
jnz nsyse4
|
|
||||||
test ebx,ebx
|
|
||||||
jz nosesl
|
|
||||||
cmp ebx, 4
|
|
||||||
ja nosesl
|
|
||||||
mov [cd_base],bl
|
|
||||||
cmp ebx,1
|
|
||||||
jnz noprma
|
|
||||||
mov [cdbase],0x1f0
|
|
||||||
mov [cdid],0xa0
|
|
||||||
noprma:
|
|
||||||
cmp ebx,2
|
|
||||||
jnz noprsl
|
|
||||||
mov [cdbase],0x1f0
|
|
||||||
mov [cdid],0xb0
|
|
||||||
noprsl:
|
|
||||||
cmp ebx,3
|
|
||||||
jnz nosema
|
|
||||||
mov [cdbase],0x170
|
|
||||||
mov [cdid],0xa0
|
|
||||||
nosema:
|
|
||||||
cmp ebx,4
|
|
||||||
jnz nosesl
|
|
||||||
mov [cdbase],0x170
|
|
||||||
mov [cdid],0xb0
|
|
||||||
nosesl:
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
mov ebx,keymap_shift
|
||||||
|
mov ecx,128
|
||||||
|
call memmove
|
||||||
|
ret
|
||||||
|
kbnoshift:
|
||||||
|
dec ecx
|
||||||
|
jnz kbnoalt
|
||||||
|
mov ebx,keymap_alt
|
||||||
|
mov ecx,128
|
||||||
|
call memmove
|
||||||
|
ret
|
||||||
|
kbnoalt:
|
||||||
|
sub ecx,6
|
||||||
|
jnz kbnocountry
|
||||||
|
mov word [keyboard],dx
|
||||||
|
ret
|
||||||
|
kbnocountry:
|
||||||
|
mov [esp+32],dword 1
|
||||||
|
ret
|
||||||
|
nsyse2:
|
||||||
|
dec ebx ; CD
|
||||||
|
jnz nsyse4
|
||||||
|
|
||||||
|
test ecx,ecx
|
||||||
|
jz nosesl
|
||||||
|
|
||||||
|
cmp ecx, 4
|
||||||
|
ja nosesl
|
||||||
|
mov [cd_base],cl
|
||||||
|
|
||||||
|
dec ecx
|
||||||
|
jnz noprma
|
||||||
|
mov [cdbase],0x1f0
|
||||||
|
mov [cdid],0xa0
|
||||||
|
noprma:
|
||||||
|
|
||||||
|
dec ecx
|
||||||
|
jnz noprsl
|
||||||
|
mov [cdbase],0x1f0
|
||||||
|
mov [cdid],0xb0
|
||||||
|
noprsl:
|
||||||
|
dec ecx
|
||||||
|
jnz nosema
|
||||||
|
mov [cdbase],0x170
|
||||||
|
mov [cdid],0xa0
|
||||||
|
nosema:
|
||||||
|
dec ecx
|
||||||
|
jnz nosesl
|
||||||
|
mov [cdbase],0x170
|
||||||
|
mov [cdid],0xb0
|
||||||
|
nosesl:
|
||||||
|
ret
|
||||||
|
|
||||||
|
iglobal
|
||||||
cd_base db 0
|
cd_base db 0
|
||||||
|
|
||||||
|
endg
|
||||||
nsyse4:
|
nsyse4:
|
||||||
|
|
||||||
; cmp eax,5 ; SYSTEM LANGUAGE
|
sub ebx,2 ; SYSTEM LANGUAGE
|
||||||
sub eax,2
|
jnz nsyse5
|
||||||
jnz nsyse5
|
mov [syslang],ecx
|
||||||
mov [syslang],ebx
|
ret
|
||||||
ret
|
|
||||||
nsyse5:
|
nsyse5:
|
||||||
|
|
||||||
|
sub ebx,2 ; HD BASE
|
||||||
|
jnz nsyse7
|
||||||
|
|
||||||
; cmp eax,7 ; HD BASE
|
test ecx,ecx
|
||||||
sub eax,2
|
jz nosethd
|
||||||
jnz nsyse7
|
|
||||||
test ebx,ebx
|
cmp ecx,4
|
||||||
jz nosethd
|
ja nosethd
|
||||||
cmp ebx,4
|
mov [hd_base],cl
|
||||||
ja nosethd
|
|
||||||
mov [hd_base],bl
|
cmp ecx,1
|
||||||
cmp ebx,1
|
jnz noprmahd
|
||||||
jnz noprmahd
|
mov [hdbase],0x1f0
|
||||||
mov [hdbase],0x1f0
|
and dword [hdid],0x0
|
||||||
mov [hdid],0x0
|
mov dword [hdpos],ecx
|
||||||
mov [hdpos],1
|
|
||||||
; call set_FAT32_variables
|
; call set_FAT32_variables
|
||||||
noprmahd:
|
noprmahd:
|
||||||
cmp ebx,2
|
|
||||||
jnz noprslhd
|
cmp ecx,2
|
||||||
mov [hdbase],0x1f0
|
jnz noprslhd
|
||||||
mov [hdid],0x10
|
mov [hdbase],0x1f0
|
||||||
mov [hdpos],2
|
mov [hdid],0x10
|
||||||
|
mov dword [hdpos],ecx
|
||||||
; call set_FAT32_variables
|
; call set_FAT32_variables
|
||||||
noprslhd:
|
noprslhd:
|
||||||
cmp ebx,3
|
|
||||||
jnz nosemahd
|
cmp ecx,3
|
||||||
mov [hdbase],0x170
|
jnz nosemahd
|
||||||
mov [hdid],0x0
|
mov [hdbase],0x170
|
||||||
mov [hdpos],3
|
and dword [hdid],0x0
|
||||||
|
mov dword [hdpos],ecx
|
||||||
; call set_FAT32_variables
|
; call set_FAT32_variables
|
||||||
nosemahd:
|
nosemahd:
|
||||||
cmp ebx,4
|
|
||||||
jnz noseslhd
|
cmp ecx,4
|
||||||
mov [hdbase],0x170
|
jnz noseslhd
|
||||||
mov [hdid],0x10
|
mov [hdbase],0x170
|
||||||
mov [hdpos],4
|
mov [hdid],0x10
|
||||||
|
mov dword [hdpos],ecx
|
||||||
; call set_FAT32_variables
|
; call set_FAT32_variables
|
||||||
noseslhd:
|
noseslhd:
|
||||||
call reserve_hd1
|
call reserve_hd1
|
||||||
call reserve_hd_channel
|
call reserve_hd_channel
|
||||||
call free_hd_channel
|
call free_hd_channel
|
||||||
mov [hd1_status],0 ; free
|
and dword [hd1_status],0 ; free
|
||||||
nosethd:
|
nosethd:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
hd_base db 0
|
hd_base db 0
|
||||||
@ -1577,43 +1577,42 @@ endg
|
|||||||
nsyse7:
|
nsyse7:
|
||||||
|
|
||||||
; cmp eax,8 ; HD PARTITION
|
; cmp eax,8 ; HD PARTITION
|
||||||
dec eax
|
dec ebx
|
||||||
jnz nsyse8
|
jnz nsyse8
|
||||||
mov [fat32part],ebx
|
mov [fat32part],ecx
|
||||||
; call set_FAT32_variables
|
; call set_FAT32_variables
|
||||||
call reserve_hd1
|
call reserve_hd1
|
||||||
call reserve_hd_channel
|
call reserve_hd_channel
|
||||||
call free_hd_channel
|
call free_hd_channel
|
||||||
pusha
|
; pusha
|
||||||
call choice_necessity_partition_1
|
call choice_necessity_partition_1
|
||||||
popa
|
; popa
|
||||||
mov [hd1_status],0 ; free
|
and dword [hd1_status],0 ; free
|
||||||
ret
|
ret
|
||||||
|
|
||||||
nsyse8:
|
nsyse8:
|
||||||
; cmp eax,11 ; ENABLE LBA READ
|
; cmp eax,11 ; ENABLE LBA READ
|
||||||
sub eax,3
|
and ecx,1
|
||||||
jnz no_set_lba_read
|
sub ebx,3
|
||||||
and ebx,1
|
jnz no_set_lba_read
|
||||||
mov [lba_read_enabled],ebx
|
mov [lba_read_enabled],ecx
|
||||||
ret
|
ret
|
||||||
|
|
||||||
no_set_lba_read:
|
no_set_lba_read:
|
||||||
; cmp eax,12 ; ENABLE PCI ACCESS
|
; cmp eax,12 ; ENABLE PCI ACCESS
|
||||||
dec eax
|
dec ebx
|
||||||
jnz no_set_pci_access
|
jnz no_set_pci_access
|
||||||
and ebx,1
|
mov [pci_access_enabled],ecx
|
||||||
mov [pci_access_enabled],ebx
|
ret
|
||||||
ret
|
no_set_pci_access:
|
||||||
no_set_pci_access:
|
|
||||||
|
|
||||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
include 'vmodeint.inc'
|
include 'vmodeint.inc'
|
||||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
sys_setup_err:
|
sys_setup_err:
|
||||||
mov [esp+36],dword -1
|
or [esp+32],dword -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
|
||||||
@ -1627,100 +1626,114 @@ sys_getsetup:
|
|||||||
; 8=fat32 partition in hd
|
; 8=fat32 partition in hd
|
||||||
; 9=get hs timer tic
|
; 9=get hs timer tic
|
||||||
|
|
||||||
cmp eax,1
|
; cmp eax,1
|
||||||
jne ngsyse1
|
dec ebx
|
||||||
movzx eax,[midi_base]
|
jnz ngsyse1
|
||||||
mov [esp+36],eax
|
movzx eax,[midi_base]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
ngsyse1:
|
ngsyse1:
|
||||||
|
; cmp eax,2
|
||||||
|
dec ebx
|
||||||
|
jnz ngsyse2
|
||||||
|
|
||||||
cmp eax,2
|
mov edi,[TASK_BASE]
|
||||||
jne ngsyse2
|
add edi,[edi+TASKDATA.mem_start]
|
||||||
cmp ebx,1
|
mov ebx,edi
|
||||||
jnz kbnobaseret
|
|
||||||
mov edi,[TASK_BASE]
|
; cmp ebx,1
|
||||||
add ecx,[edi+TASKDATA.mem_start]
|
dec ecx
|
||||||
mov ebx,ecx
|
jnz kbnobaseret
|
||||||
mov eax,keymap
|
mov eax,keymap
|
||||||
mov ecx,128
|
mov ecx,128
|
||||||
call memmove
|
call memmove
|
||||||
ret
|
ret
|
||||||
kbnobaseret:
|
kbnobaseret:
|
||||||
cmp ebx,2
|
; cmp ebx,2
|
||||||
jnz kbnoshiftret
|
dec ecx
|
||||||
mov edi,[TASK_BASE]
|
jnz kbnoshiftret
|
||||||
add ecx,[edi+TASKDATA.mem_start]
|
|
||||||
mov ebx,ecx
|
mov eax,keymap_shift
|
||||||
mov eax,keymap_shift
|
mov ecx,128
|
||||||
mov ecx,128
|
call memmove
|
||||||
call memmove
|
ret
|
||||||
ret
|
|
||||||
kbnoshiftret:
|
kbnoshiftret:
|
||||||
cmp ebx,3
|
; cmp ebx,3
|
||||||
jne kbnoaltret
|
dec ecx
|
||||||
mov edi,[TASK_BASE]
|
jne kbnoaltret
|
||||||
add ecx,[edi+TASKDATA.mem_start]
|
|
||||||
mov ebx,ecx
|
|
||||||
mov eax,keymap_alt
|
|
||||||
mov ecx,128
|
mov eax,keymap_alt
|
||||||
call memmove
|
mov ecx,128
|
||||||
ret
|
call memmove
|
||||||
|
ret
|
||||||
kbnoaltret:
|
kbnoaltret:
|
||||||
cmp ebx,9
|
; cmp ebx,9
|
||||||
jnz ngsyse2
|
sub ecx,6
|
||||||
movzx eax,word [keyboard]
|
jnz ngsyse2
|
||||||
mov [esp+36],eax
|
movzx eax,word [keyboard]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
|
|
||||||
|
|
||||||
ngsyse2:
|
ngsyse2:
|
||||||
|
; cmp eax,3
|
||||||
cmp eax,3
|
dec ebx
|
||||||
jnz ngsyse3
|
jnz ngsyse3
|
||||||
movzx eax,[cd_base]
|
movzx eax,[cd_base]
|
||||||
mov [esp+36],eax
|
mov [esp+32],eax
|
||||||
ret
|
ret
|
||||||
ngsyse3:
|
ngsyse3:
|
||||||
cmp eax,5
|
; cmp eax,5
|
||||||
jnz ngsyse5
|
sub ebx,2
|
||||||
mov eax,[syslang]
|
jnz ngsyse5
|
||||||
mov [esp+36],eax
|
mov eax,[syslang]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
ngsyse5:
|
ngsyse5:
|
||||||
cmp eax,7
|
; cmp eax,7
|
||||||
jnz ngsyse7
|
sub ebx,2
|
||||||
movzx eax,[hd_base]
|
jnz ngsyse7
|
||||||
mov [esp+36],eax
|
movzx eax,[hd_base]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
ngsyse7:
|
ngsyse7:
|
||||||
cmp eax,8
|
; cmp eax,8
|
||||||
jnz ngsyse8
|
dec ebx
|
||||||
mov eax,[fat32part]
|
jnz ngsyse8
|
||||||
mov [esp+36],eax
|
mov eax,[fat32part]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
ngsyse8:
|
ngsyse8:
|
||||||
cmp eax,9
|
; cmp eax,9
|
||||||
jne ngsyse9
|
dec ebx
|
||||||
mov eax,[timer_ticks] ;[0xfdf0]
|
jnz ngsyse9
|
||||||
mov [esp+36],eax
|
mov eax,[timer_ticks] ;[0xfdf0]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
ngsyse9:
|
ngsyse9:
|
||||||
cmp eax,11
|
; cmp eax,11
|
||||||
jnz ngsyse11
|
sub ebx,2
|
||||||
mov eax,[lba_read_enabled]
|
jnz ngsyse11
|
||||||
mov [esp+36],eax
|
mov eax,[lba_read_enabled]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
ngsyse11:
|
ngsyse11:
|
||||||
cmp eax,12
|
; cmp eax,12
|
||||||
jnz ngsyse12
|
dec ebx
|
||||||
mov eax,[pci_access_enabled]
|
jnz ngsyse12
|
||||||
mov [esp+36],eax
|
mov eax,[pci_access_enabled]
|
||||||
ret
|
mov [esp+32],eax
|
||||||
|
ret
|
||||||
ngsyse12:
|
ngsyse12:
|
||||||
mov [esp+36],dword 1
|
mov [esp+32],dword 1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
get_timer_ticks:
|
get_timer_ticks:
|
||||||
mov eax,[timer_ticks]
|
mov eax,[timer_ticks]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
iglobal
|
iglobal
|
||||||
align 4
|
align 4
|
||||||
@ -1782,12 +1795,12 @@ msz:
|
|||||||
shl eax,16
|
shl eax,16
|
||||||
mov ax,[MOUSE_SCROLL_V]
|
mov ax,[MOUSE_SCROLL_V]
|
||||||
mov [esp+36],eax
|
mov [esp+36],eax
|
||||||
mov [MOUSE_SCROLL_H],word 0
|
and [MOUSE_SCROLL_H],word 0
|
||||||
mov [MOUSE_SCROLL_V],word 0
|
and [MOUSE_SCROLL_V],word 0
|
||||||
ret
|
ret
|
||||||
@@:
|
@@:
|
||||||
mov [esp+36],dword 0
|
and [esp+36],dword 0
|
||||||
ret
|
; ret
|
||||||
msset:
|
msset:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
@ -1846,67 +1859,56 @@ put_mpu_out:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
setuart:
|
|
||||||
|
|
||||||
su1:
|
|
||||||
call is_output
|
|
||||||
cmp al,0
|
|
||||||
jnz su1
|
|
||||||
mov dx,word [midisp]
|
|
||||||
mov al,0xff
|
|
||||||
out dx,al
|
|
||||||
su2:
|
|
||||||
mov dx,word [midisp]
|
|
||||||
mov al,0xff
|
|
||||||
out dx,al
|
|
||||||
call is_input
|
|
||||||
cmp al,0
|
|
||||||
jnz su2
|
|
||||||
call get_mpu_in
|
|
||||||
cmp al,0xfe
|
|
||||||
jnz su2
|
|
||||||
su3:
|
|
||||||
call is_output
|
|
||||||
cmp al,0
|
|
||||||
jnz su3
|
|
||||||
mov dx,word [midisp]
|
|
||||||
mov al,0x3f
|
|
||||||
out dx,al
|
|
||||||
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
||||||
align 4
|
align 4
|
||||||
|
|
||||||
sys_midi:
|
sys_midi:
|
||||||
|
cmp [mididp],0
|
||||||
cmp [mididp],0
|
jnz sm0
|
||||||
jnz sm0
|
mov [esp+36],dword 1
|
||||||
mov [esp+36],dword 1
|
ret
|
||||||
ret
|
sm0:
|
||||||
sm0:
|
and [esp+36],dword 0
|
||||||
|
dec ebx
|
||||||
cmp eax,1
|
jnz smn1
|
||||||
mov [esp+36],dword 0
|
; call setuart
|
||||||
jnz smn1
|
su1:
|
||||||
call setuart
|
call is_output
|
||||||
ret
|
test al,al
|
||||||
smn1:
|
jnz su1
|
||||||
|
mov dx,word [midisp]
|
||||||
cmp eax,2
|
mov al,0xff
|
||||||
jnz smn2
|
out dx,al
|
||||||
sm10:
|
su2:
|
||||||
call get_mpu_in
|
mov dx,word [midisp]
|
||||||
call is_output
|
mov al,0xff
|
||||||
test al,al
|
out dx,al
|
||||||
jnz sm10
|
call is_input
|
||||||
mov al,bl
|
test al,al
|
||||||
call put_mpu_out
|
jnz su2
|
||||||
ret
|
call get_mpu_in
|
||||||
smn2:
|
cmp al,0xfe
|
||||||
|
jnz su2
|
||||||
ret
|
su3:
|
||||||
|
call is_output
|
||||||
|
test al,al
|
||||||
|
jnz su3
|
||||||
|
mov dx,word [midisp]
|
||||||
|
mov al,0x3f
|
||||||
|
out dx,al
|
||||||
|
ret
|
||||||
|
smn1:
|
||||||
|
dec ebx
|
||||||
|
jnz smn2
|
||||||
|
sm10:
|
||||||
|
call get_mpu_in
|
||||||
|
call is_output
|
||||||
|
test al,al
|
||||||
|
jnz sm10
|
||||||
|
mov al,bl
|
||||||
|
call put_mpu_out
|
||||||
|
smn2:
|
||||||
|
ret
|
||||||
|
|
||||||
detect_devices:
|
detect_devices:
|
||||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
@ -1918,7 +1920,6 @@ detect_devices:
|
|||||||
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
sys_end:
|
sys_end:
|
||||||
|
|
||||||
mov ecx, [current_slot]
|
mov ecx, [current_slot]
|
||||||
@ -2531,8 +2532,8 @@ nosb7:
|
|||||||
ret
|
ret
|
||||||
|
|
||||||
force_redraw_background:
|
force_redraw_background:
|
||||||
mov [draw_data+32 + RECT.left],dword 0
|
and [draw_data+32 + RECT.left],dword 0
|
||||||
mov [draw_data+32 + RECT.top],dword 0
|
and [draw_data+32 + RECT.top],dword 0
|
||||||
push eax ebx
|
push eax ebx
|
||||||
mov eax,[Screen_Max_X]
|
mov eax,[Screen_Max_X]
|
||||||
mov ebx,[Screen_Max_Y]
|
mov ebx,[Screen_Max_Y]
|
||||||
@ -3819,7 +3820,7 @@ delay_hs: ; delay in 1/100 secs
|
|||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
align 16 ;very often call this subrutine
|
||||||
memmove: ; memory move in bytes
|
memmove: ; memory move in bytes
|
||||||
|
|
||||||
; eax = from
|
; eax = from
|
||||||
@ -3828,7 +3829,6 @@ memmove: ; memory move in bytes
|
|||||||
test ecx, ecx
|
test ecx, ecx
|
||||||
jle .ret
|
jle .ret
|
||||||
|
|
||||||
|
|
||||||
push esi edi ecx
|
push esi edi ecx
|
||||||
|
|
||||||
mov edi, ebx
|
mov edi, ebx
|
||||||
@ -5065,7 +5065,7 @@ sys_gs: ; direct screen access
|
|||||||
ret
|
ret
|
||||||
no_gs3:
|
no_gs3:
|
||||||
|
|
||||||
mov [esp+36],dword -1
|
or [esp+36],dword -1
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,15 +24,16 @@ uglobal
|
|||||||
old_screen_height dd ?
|
old_screen_height dd ?
|
||||||
endg
|
endg
|
||||||
|
|
||||||
cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
|
; cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
|
||||||
jne .no_vmode_drv_access
|
dec ebx
|
||||||
|
jnz .no_vmode_drv_access
|
||||||
pushd [Screen_Max_X] [Screen_Max_Y]
|
pushd [Screen_Max_X] [Screen_Max_Y]
|
||||||
popd [old_screen_height] [old_screen_width]
|
popd [old_screen_height] [old_screen_width]
|
||||||
or eax,-1 ; If driver is absent then eax does not change
|
or eax,-1 ; If driver is absent then eax does not change
|
||||||
call (VMODE_BASE+0x100) ; Entry point of video driver
|
call (VMODE_BASE+0x100) ; Entry point of video driver
|
||||||
mov [esp+36],eax
|
mov [esp+36-4],eax
|
||||||
mov [esp+24],ebx
|
mov [esp+24-4],ebx
|
||||||
mov [esp+32],ecx
|
mov [esp+32-4],ecx
|
||||||
; mov [esp+28],edx
|
; mov [esp+28],edx
|
||||||
mov eax,[old_screen_width]
|
mov eax,[old_screen_width]
|
||||||
mov ebx,[old_screen_height]
|
mov ebx,[old_screen_height]
|
||||||
@ -46,8 +47,8 @@ endg
|
|||||||
sub [screen_workarea.bottom],ebx
|
sub [screen_workarea.bottom],ebx
|
||||||
|
|
||||||
call repos_windows
|
call repos_windows
|
||||||
mov eax, 0
|
xor eax,eax
|
||||||
mov ebx, 0
|
xor ebx,ebx
|
||||||
mov ecx, [Screen_Max_X]
|
mov ecx, [Screen_Max_X]
|
||||||
mov edx, [Screen_Max_Y]
|
mov edx, [Screen_Max_Y]
|
||||||
call calculatescreen
|
call calculatescreen
|
||||||
|
Loading…
Reference in New Issue
Block a user