/kernel/branches/Kolibri-A/trunk/const.inc |
---|
206,10 → 206,8 |
GETPIXEL equ (OS_BASE+0x0006824) |
mouseunder equ (OS_BASE+0x0006900) |
IDE_DMA equ 0x0007000 |
MOUSE_VISIBLE equ (OS_BASE+0x000F204) |
WIN_TEMP_XY equ (OS_BASE+0x000F300) |
KEY_COUNT equ (OS_BASE+0x000F400) |
268,12 → 266,11 |
DONT_DRAW_MOUSE equ (OS_BASE+0x000FFF5) |
DONT_SWITCH equ (OS_BASE+0x000FFFF) |
FONT_II equ (OS_BASE+0x005DC00) |
FONT_I equ (OS_BASE+0x005E600) |
TMP_STACK_TOP equ 0x006CC00 |
TMP_STACK_TOP equ 0x006C000 |
FONT_II equ (OS_BASE+0x006DC00) |
FONT_I equ (OS_BASE+0x006E600) |
mmio_pte equ 0x006E000 |
sys_pgdir equ (OS_BASE+0x006F000) |
DRIVE_DATA equ (OS_BASE+0x0070000) |
280,6 → 277,8 |
SLOT_BASE equ (OS_BASE+0x0080000) |
;unused |
;TMP_BUFF equ (OS_BASE+0x0090000) |
;VGABasePtr equ (OS_BASE+0x00A0000) |
287,18 → 286,25 |
RAMDISK_FAT equ (OS_BASE+0x0280000) |
CLEAN_ZONE equ 0x280000 |
IDE_DMA equ 0x284000 |
BgrAuxTable equ (OS_BASE+0x0298000) |
; unused? |
SB16Buffer equ (OS_BASE+0x02A0000) |
SB16_Status equ (OS_BASE+0x02B0000) |
BUTTON_INFO equ (OS_BASE+0x02C0000) |
RESERVED_PORTS equ (OS_BASE+0x02D0000) |
IRQ_SAVE equ (OS_BASE+0x02E0000) |
;BOOT_VAR equ (OS_BASE+0x02F0000) |
stack_data_start equ (OS_BASE+0x0300000) |
eth_data_start equ (OS_BASE+0x0300000) |
stack_data equ (OS_BASE+0x0304000) |
stack_data_end equ (OS_BASE+0x031ffff) |
resendQ equ (OS_BASE+0x0320000) |
BgrAuxTable equ (OS_BASE+0x0328000) |
;VMODE_BASE equ (OS_BASE+0x0328000) |
skin_data equ (OS_BASE+0x0330000) |
draw_data equ (OS_BASE+0x0338000); |
321,8 → 327,6 |
PCIe_CONFIG_SPACE equ 0xF0000000 |
USER_DMA_BUFFER equ 0xFD000000 ; linear addr. |
USER_DMA_SIZE equ 0x00800000 |
FUSION_MMIO equ 0xFD800000 |
LAPIC_BAR equ 0xFD800000 ; == |
page_tabs equ 0xFDC00000 |
app_page_tabs equ 0xFDC00000 |
/kernel/branches/Kolibri-A/trunk/kernel.asm |
---|
508,11 → 508,11 |
out 0xA1, al |
; Enable interrupts in IDE controller |
; mov al, 0 |
; mov dx, 0x3F6 |
; out dx, al |
; mov dl, 0x76 |
; out dx, al |
mov al, 0 |
mov dx, 0x3F6 |
out dx, al |
mov dl, 0x76 |
out dx, al |
;!!!!!!!!!!!!!!!!!!!!!!!!!! |
include 'detect/disks.inc' |
721,8 → 721,7 |
; LOAD FIRST APPLICATION |
cli |
if 0 |
<<< |
cmp byte [BOOT_VAR+0x9030],1 |
jne no_load_vrr_m |
733,8 → 732,8 |
sub eax,2 |
jz first_app_found |
no_load_vrr_m: <<< |
end if |
no_load_vrr_m: |
mov ebp, firstapp |
call fs_execute_from_sysdir |
/kernel/branches/Kolibri-A/trunk/memmap.inc |
---|
70,11 → 70,15 |
; 6000 -> 68FF << free (2k5) |
; 6900 -> 6EFF << saved picture under mouse pointer (1k5) |
; 6900 -> 7EFF << saved picture under mouse pointer (1k5) |
; |
; 7000 -> EFFF HDD DMA AREA (32k) |
; 7F00 -> 7FFF << SB16_Status (256) \\ |
; |
; 8000 -> 87FF free (2k) |
; 0x80008000 -> 9FFF ramdisk fat (8k) |
; A000 -> F9FF free (23k) |
; FA00 byte no of keys in buffer |
; FA01 byte 'buffer' |
; FA02 -> FAFF reserved for keys |
147,13 → 151,11 |
; -> 3B752 end_of_kernel |
; -> 3C000 not used (>200k) |
; 0x80050000 -> 090000 zero-filled zone after preinit_mem |
; 0x8006DC00 -> 5E5FF basic text font II |
; 0x8006E600 -> 5Efff basic text font I |
; 0x8006C000 -> 6CFFF stack at boot time (4Kb) |
; 0x8006CC00 -> 6DBFF stack at boot time (4Kb) |
; |
; 0x8006E000 -> 6EFFF MMIO PTE directory (4Kb) |
; 0x8006F000 -> 6FFFF main page directory (4Kb) |
; 0x8006DC00 -> 6E5FF basic text font II |
; 0x8006E600 -> 6Efff basic text font I |
; 0x8006F000 -> 6FFFF main page directory |
; 0x80070000 -> 7FFFF data of retrieved disks and partitions (Mario79) |
; 0x80080000 -> 8FFFF additional app info, in 256 byte steps - 256 entries |
198,17 → 200,29 |
; BC dword address of debug event memory |
; C0 5 dd thread debug registers: DR0,DR1,DR2,DR3,DR7 |
; |
; 0x80090000 -> 9FFFF free (64k) |
; 0x80090000 -> 9FFFF wav device buffer (64k) ; << SB16Buffer |
; 0x800A0000 -> AFFFF screen access area << VGA legacy buffer |
; 0x800B0000 -> FFFFF bios rest in peace -area (320k), << purpose unknown |
; 0x80100000 -> 283FFF diskette image (1m5) |
; 0x80280000 -> 9FFF ramdisk fat (8k) |
; 0x80280000 -> HEAP_BASE zero-filled zone after preinit_mem |
; 0x80284000 -> HEAP_BASE zero-filled zone after preinit_mem |
; |
; 0x80280000 -> 2Bffff free (262k) |
; 0x80284000 -> 28BFFF HDD DMA AREA (32k) |
; 0x8028C000 -> 297FFF free (48k) |
; |
; 0x80298000 -> 29ffff auxiliary table for background smoothing code (32k) |
; |
; 0x802A0000 -> 2Bffff free (128k) |
; 0x80328000 -> 32FFFF !vrr driver (32k) |
; 0x80338000 -> 338FFF draw data - 256 entries (4k) |
; 00 dword draw limit - x start |
; 04 dword draw limit - y start |
; 08 dword draw limit - x end |
; 0C dword draw limit - y end |
; 0x80339000 -> 3BFFF3 free (12k) |
; 0x802C0000 -> 2C3fff button info (8k) |
; |
; 0000 word number of buttons |
230,20 → 244,8 |
; dword start port |
; dword end port |
; dword 0 |
; 0x802E0000 -> 2EFFFF irq data area (64k) |
; 0x802F0000 -> 327fff free (229k) |
; 0x80328000 -> 29ffff auxiliary table for background smoothing code (32k) |
; |
; 0x80338000 -> 338FFF draw data - 256 entries (4k) |
; 00 dword draw limit - x start |
; 04 dword draw limit - y start |
; 08 dword draw limit - x end |
; 0C dword draw limit - y end |
; 0x80339000 -> 3BFFF3 free (12k) |
; |
; 0x80370000 -> 37FFFF irq data area (64k) |
; 0x80380000 -> 38FFFF low memory save (64k) |
; |
; 0x80390000 -> 3AFFFF tcp memory (128k) |
263,10 → 265,7 |
; 0x80800000 ->827FFFFF kernel heap |
; 0xF0000000 -> 0xF1FFFFFF PCI-express extended config space |
; 0xFD000000 -> 0xFD7FFFFF static system buffer (8Mb reserved) |
; 0xFD800000 -> 0xFBFFFFFF CPU & Southbridge memory-mapped IO (4Mb reserved) |
; +0000..0FFF LAPIC BAR (4k) |
; 0xFD000000 -> 0xFD3FFFFF static system buffer 4Mb |
; 0xFDC00000 -> 0xFDFFFFFF page tables 4Mb |
; 0xFE000000 -> 0xFFFFFFFF LFB 32Mb |
; 0xFE000000 -> 0xFE7FFFFF application available LFB 8Mb |
/kernel/branches/Kolibri-A/trunk/core/sched.inc |
---|
20,6 → 20,7 |
mov es, ax |
inc [timer_ticks] |
mov eax, [timer_ticks] |
; call playNote ; <<<--- Speaker driver |
sub eax,[next_usage_update] |
cmp eax,100 |
jb .nocounter |
/kernel/branches/Kolibri-A/trunk/boot/bootcode.inc |
---|
62,6 → 62,10 |
; mov [es:0x901C], al |
; VRR_M USE |
; mov [es:0x9030], byte 2 |
; BOOT DEVICE |
xor ax, ax |
/kernel/branches/Kolibri-A/trunk/data32.inc |
---|
105,7 → 105,7 |
bootpath db '/KOLIBRI ' |
bootpath2 db 0 |
vmode db '/sys/drivers/VMODE.MDR',0 |
;vrr_m db 'VRR_M',0 |
vrr_m db 'VRR_M',0 |
kernel_file db 'KERNEL MNT' |
/kernel/branches/Kolibri-A/trunk/bus/HT.inc |
---|
145,7 → 145,7 |
; (eax = phys. address of PCIe conf.space) |
; |
map_pcie_pages: |
or eax, (PG_NOCACHE + PG_SHARED + PG_LARGE + PG_UW) ; UW is unsafe! |
or eax, (PG_NOCACHE + PG_SHARED + PG_LARGE + PG_UW) ; UW is unsafe, fix it! |
mov ecx, PCIe_CONFIG_SPACE ; linear address |
mov ebx, ecx |
shr ebx, 20 |
163,9 → 163,13 |
add eax, 0x400000 ; +4M phys. |
add ecx, 0x400000 ; +4M lin. |
cmp dl, byte[mmio_pcie_cfg_pdes-OS_BASE] |
jae pcie_cfg_mapped |
jae .pcie_cfg_mapped |
inc dl |
jmp .write_pde |
; mov eax, cr3 |
; mov cr3, eax ; flush TLB |
.pcie_cfg_mapped: |
ret ; <<< OK >>> |
; ---- stepping 10h CPUs and Fusion APUs: the configspace is stored in MSR_C001_0058 ---- |
align 4 |
192,26 → 196,8 |
add edx, eax ; the upper configspace limit |
mov dword[mmio_pcie_cfg_lim-OS_BASE], edx |
pcie_cfg_mapped: |
jmp map_pcie_pages |
create_mmio_pte: |
mov ecx, mmio_pte ; physical address |
or ecx, (PG_NOCACHE + PG_SHARED) |
mov ebx, FUSION_MMIO ; linear address |
shr ebx, 20 |
add ebx, (sys_pgdir - OS_BASE) ; PgDir entry @ |
mov dword[ebx], ecx ; Fusion MMIO tables |
map_apic_mmio: |
mov ecx, 0x01B ; APIC BAR |
rdmsr |
and eax, 0xFFFFF000 ; physical address |
or eax, (PG_NOCACHE + PG_SHARED + PG_UW) ; UW is unsafe! |
mov dword[mmio_pte + 0], eax |
ret ; <<< OK >>> |
; ================================================================================ |
org OS_BASE+$ ; back to the linear address space |
/kernel/branches/Kolibri-A/trunk/detect/dev_hdcd.inc |
---|
21,13 → 21,25 |
mov [ChannelNumber],1 |
mov [DiskNumber],0 |
call FindHDD_3 |
; mov ax,[Sector512+176] |
; mov [DRIVE_DATA+6],ax |
; mov ax,[Sector512+126] |
; mov [DRIVE_DATA+8],ax |
; mov ax,[Sector512+128] |
; mov [DRIVE_DATA+8],ax |
mov [DiskNumber],1 |
call FindHDD_3 |
; mov al,[Sector512+176] |
; mov [DRIVE_DATA+7],al |
inc [ChannelNumber] |
mov [DiskNumber],0 |
call FindHDD_3 |
; mov al,[Sector512+176] |
; mov [DRIVE_DATA+8],al |
mov [DiskNumber],1 |
call FindHDD_1 |
; mov al,[Sector512+176] |
; mov [DRIVE_DATA+9],al |
jmp EndFindHDD |
45,9 → 57,9 |
call DeviceReset |
cmp [DevErrorCode],0 |
jne FindHDD_2_2 |
; call ReadCD_ID |
; cmp [DevErrorCode],0 |
; jne FindHDD_2_2 |
call ReadCD_ID |
cmp [DevErrorCode],0 |
jne FindHDD_2_2 |
inc byte [DRIVE_DATA+1] |
inc byte [DRIVE_DATA+1] |
FindHDD_2_2: |
99,6 → 111,8 |
test AL,08h ;ñîñòîÿíèå ñèãíàëà DRQ |
jz @@WaitCompleet |
; Ïðèíÿòü áëîê äàííûõ îò êîíòðîëëåðà |
; mov AX,DS |
; mov ES,AX |
mov EDI,Sector512 ;offset Sector512 |
mov DX,[ATABasePortAddr] ;ðåãèñòð äàííûõ |
mov CX,256 ;÷èñëî ñ÷èòûâàåìûõ ñëîâ |
187,10 → 201,17 |
; Îæèäàòü, ïîêà äèñê íå áóäåò ãîòîâ |
inc DX |
mov ecx,0xfff |
; mov eax,[timer_ticks] |
; mov [TickCounter_1],eax |
@@WaitHDReady: |
; Ïðîâåðèòü âðåìÿ îæèäàíè |
dec ecx |
; cmp ecx,0 |
jz @@Err1 |
; mov eax,[timer_ticks] |
; sub eax,[TickCounter_1] |
; cmp eax,300 ;îæèäàòü 300 òèêîâ |
; ja @@Err1 ;îøèáêà òàéì-àóòà |
; Ïðî÷èòàòü ðåãèñòð ñîñòîÿíè |
in AL,DX |
; Ïðîâåðèòü ñîñòîÿíèå ñèãíàëà BSY |
249,7 → 270,6 |
; Çàâåðøåíèå ðàáîòû ïðîãðàììû |
ret |
if 0 |
;************************************************* |
;* ×ÒÅÍÈÅ ÈÄÅÍÒÈÔÈÊÀÒÎÐÀ ÓÑÒÐÎÉÑÒÂÀ ATAPI * |
;* Âõîäíûå ïàðàìåòðû ïåðåäàþòñÿ ÷åðåç ãëîáàëüíûå * |
279,6 → 299,7 |
@@WaitCompleet_1: |
; Ïðîâåðèòü âðåì |
dec ecx |
; cmp ecx,0 |
jz @@Error1_1 ;îøèáêà òàéì-àóòà |
; Ïðîâåðèòü ãîòîâíîñòü |
in AL,DX |
289,6 → 310,8 |
test AL,08h ;ñîñòîÿíèå ñèãíàëà DRQ |
jz @@WaitCompleet_1 |
; Ïðèíÿòü áëîê äàííûõ îò êîíòðîëëåðà |
; mov AX,DS |
; mov ES,AX |
mov EDI,Sector512 ;offset Sector512 |
mov DX,[ATABasePortAddr] ;ïîðò 1x0h |
mov CX,256 ;÷èñëî ñ÷èòûâàåìûõ ñëîâ |
303,8 → 326,6 |
@@End_1: |
ret |
end if |
;************************************************* |
;* ÑÁÐÎÑ ÓÑÒÐÎÉÑÒÂÀ * |
;* Âõîäíûå ïàðàìåòðû ïåðåäàþòñÿ ÷åðåç ãëîáàëüíûå * |
/kernel/branches/Kolibri-A/trunk/detect/dev_fd.inc |
---|
0,0 → 1,30 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
;*************************************************** |
; ïðåäâàðèòåëüíàÿ î÷èñòêà îáëàñòè òàáëèöû |
; ïîèñê è çàíåñåíèå â òàáëèöó ïðèâîäîâ FDD |
; àâòîð Mario79 |
;*************************************************** |
xor eax,eax |
mov edi,DRIVE_DATA |
mov ecx,16384 |
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 |
Property changes: |
Added: svn:keywords |
+Rev |
\ No newline at end of property |
/kernel/branches/Kolibri-A/trunk/detect/disks.inc |
---|
8,7 → 8,7 |
$Revision$ |
;include 'dev_fd.inc' |
include 'dev_fd.inc' |
include 'dev_hdcd.inc' |
include 'getcache.inc' |
include 'sear_par.inc' |
/kernel/branches/Kolibri-A/trunk/sound/playnote.inc |
---|
0,0 → 1,166 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
;; ;; |
;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
;; Distributed under terms of the GNU General Public License ;; |
;; ;; |
;; PLAYNOTE.INC version 1.1 22 November 2003 ;; |
;; ;; |
;; Player Notes for Speaker PC ;; |
;; subfunction #55 from function #55 Menuet OS ;; |
;; ;; |
;; Copyright 2003 VaStaNi ;; |
;; vastani@ukr.net ;; |
;; >>>- SIMPLY - QUICKLY - SHORTLY -<<< ;; |
;; ;; |
;; Note: playnote.txt ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
$Revision$ |
align 4 |
sound_interface: |
cmp eax,ebx ; this is subfunction #55 ? |
jne retFunc55 ; if no then return. |
cmp byte [sound_flag],0 |
jne retFunc55 |
movzx eax, byte [countDelayNote] |
or al, al ; player is busy ? |
jnz retFunc55 ; return counter delay Note |
mov [memAdrNote],esi;edx |
call get_pid |
mov [pidProcessNote],eax |
xor eax, eax ; Ok! EAX = 0 |
retFunc55: |
mov [esp+32], eax ; return value EAX for application |
ret |
iglobal |
align 4 |
kontrOctave dw 0x4742, 0x4342, 0x3F7C, 0x3BEC, 0x388F, 0x3562 |
dw 0x3264, 0x2F8F, 0x2CE4, 0x2A5F, 0x2802, 0x25BF |
memAdrNote dd 0 |
pidProcessNote dd 0 |
slotProcessNote dd 0 |
count_timer_Note dd 1 |
mem8253r42 dw 0 |
countDelayNote db 0 |
endg |
playNote: |
; jmp NotPlayNotes |
mov esi, [memAdrNote] |
or esi, esi ; ESI = 0 ? - OFF Notes Play ? |
jz NotPlayNotes ; if ESI = 0 -> ignore play pocedure |
cmp eax, [count_timer_Note] |
jb NotPlayNotes |
push eax |
inc eax |
mov [count_timer_Note], eax |
mov al, [countDelayNote] |
dec al ; decrement counter Delay for Playing Note |
jz NewLoadNote@Delay |
cmp al, 0xFF ; this is first Note Play ? |
jne NextDelayNote |
;This is FIRST Note, save counter channel 2 chip 8253 |
mov al, 0xB6 ; control byte to timer chip 8253 |
out 0x43, al ; Send it to the control port chip 8253 |
in al, 0x42 ; Read Lower byte counter channel 2 chip 8253 |
mov ah, al ; AH = Lower byte counter channel 2 |
in al, 0x42 ; Read Upper byte counter channel 2 chip 8253 |
mov [mem8253r42], ax ; Save counter channel 2 timer chip 8253 |
NewLoadNote@Delay: |
cld |
; lodsb ; load AL - counter Delay |
call ReadNoteByte |
or al, al ; THE END ? |
jz EndPlayNote |
cmp al, 0x81 |
jnc NoteforOctave |
mov [countDelayNote], al |
; lodsw ; load AX - counter for Note! |
call ReadNoteByte |
mov ah,al |
call ReadNoteByte |
xchg al,ah |
jmp pokeNote |
EndPlayNote: ; THE END Play Notes! |
in al, 0x61 ; Get contents of system port B chip 8255 |
and al, 0xFC ; Turn OFF timer and speaker |
out 0x61, al ; Send out new values to port B chip 8255 |
mov ax, [mem8253r42] ; memorize counter channel 2 timer chip 8253 |
xchg al, ah ; reverse byte in word |
out 0x42, al ; restore Lower byte counter channel 2 |
mov al, ah ; AL = Upper byte counter channel 2 |
out 0x42, al ; restore Upper byte channel 2 |
xor eax, eax ; EAX = 0 |
mov [memAdrNote], eax ; clear header control Delay-Note string |
NextDelayNote: |
mov [countDelayNote], al ; save new counter delay Note |
pop eax |
NotPlayNotes: |
RET |
NoteforOctave: |
sub al, 0x81 ; correction value for delay Note |
mov [countDelayNote], al ; save counter delay this new Note |
; lodsb ; load pack control code |
call ReadNoteByte |
cmp al, 0xFF ; this is PAUSE ? |
jne packCode ; no, this is PACK CODE |
in al, 0x61 ; Get contents of system port B chip 8255 |
and al, 0xFC ; Turn OFF timer and speaker |
out 0x61, al ; Send out new values to port B chip 8255 |
jmp saveESI |
packCode: |
mov cl, al ; save code |
and al, 0xF ; clear upper bits |
dec al ; correction |
add al, al ; transform number to offset constant |
movsx eax, al ; EAX - offset |
add eax, dword kontrOctave ; EAX - address from constant |
mov ax, [eax] ; read constant |
shr cl, 4 ; transform for number Octave |
shr ax, cl ; calculate from Note this Octave! |
pokeNote: |
out 0x42, al ; Lower byte Out to channel 2 timer chip 8253 |
mov al, ah |
out 0x42, al ; Upper byte Out to channel 2 timer chip 8253 |
in al, 0x61 ; Get contents of system port B chip 8255 |
or al, 3 ; Turn ON timer and speaker |
out 0x61, al ; Send out new values to port B chip 8255 |
saveESI: |
; mov [memAdrNote], esi ; save new header control Delay-Note string |
pop eax |
RET |
ReadNoteByte: |
;result: |
; al - note |
push eax |
push ecx |
push edx |
push esi |
mov eax,[pidProcessNote] |
call pid_to_slot |
test eax,eax |
jz .failed |
lea ecx,[esp+12] |
mov edx,1 |
mov esi,[memAdrNote] |
inc [memAdrNote] |
call read_process_memory |
.failed: |
pop esi |
pop edx |
pop ecx |
pop eax |
ret |
;------------------- END CODE ------------------- |
Property changes: |
Added: svn:keywords |
+Rev |
\ No newline at end of property |