forked from KolibriOS/kolibrios
Synced net branch with trunk (#3358)
git-svn-id: svn://kolibrios.org@3359 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
7e246790ed
commit
cc4161de83
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision: 2381 $
|
||||
|
||||
@ -347,16 +347,16 @@ disk_add:
|
||||
push eax ; save allocated pointer to DISK
|
||||
xor eax, eax ; the argument of malloc() is in eax
|
||||
@@:
|
||||
inc eax
|
||||
cmp byte [ebx+eax-1], 0
|
||||
jnz @b
|
||||
; 2b. Call the heap manager. Note that it can change ebx.
|
||||
push ebx
|
||||
call malloc
|
||||
pop ebx
|
||||
; 2c. Check the result. If allocation failed, go to 7.
|
||||
pop esi ; restore allocated pointer to DISK
|
||||
test eax, eax
|
||||
inc eax
|
||||
cmp byte [ebx+eax-1], 0
|
||||
jnz @b
|
||||
; 2b. Call the heap manager. Note that it can change ebx.
|
||||
push ebx
|
||||
call malloc
|
||||
pop ebx
|
||||
; 2c. Check the result. If allocation failed, go to 7.
|
||||
pop esi ; restore allocated pointer to DISK
|
||||
test eax, eax
|
||||
jz .free
|
||||
; 2d. Store the allocated pointer to the DISK structure.
|
||||
mov [esi+DISK.Name], eax
|
||||
@ -417,13 +417,13 @@ disk_add:
|
||||
; [esp+4] = handle of the disk, i.e. the pointer to the DISK structure.
|
||||
; Return value: none.
|
||||
disk_del:
|
||||
push esi ; save used registers to be stdcall
|
||||
; 1. Force media to be removed. If the media is already removed, the
|
||||
; call does nothing.
|
||||
mov esi, [esp+4+4] ; esi = handle of the disk
|
||||
stdcall disk_media_changed, esi, 0
|
||||
; 2. Delete the structure from the global list.
|
||||
; 2a. Acquire the mutex.
|
||||
push esi ; save used registers to be stdcall
|
||||
; 1. Force media to be removed. If the media is already removed, the
|
||||
; call does nothing.
|
||||
mov esi, [esp+4+4] ; esi = handle of the disk
|
||||
stdcall disk_media_changed, esi, 0
|
||||
; 2. Delete the structure from the global list.
|
||||
; 2a. Acquire the mutex.
|
||||
mov ecx, disk_list_mutex
|
||||
call mutex_lock
|
||||
; 2b. Delete item from double-linked list.
|
||||
@ -459,7 +459,9 @@ disk_dereference:
|
||||
stdcall disk_call_driver
|
||||
; 3b. Free the structure.
|
||||
xchg eax, esi
|
||||
push ebx
|
||||
call free
|
||||
pop ebx
|
||||
; 4. Return.
|
||||
.nothing:
|
||||
ret
|
||||
@ -623,14 +625,14 @@ disk_default_closemedia:
|
||||
disk_default_flush:
|
||||
xor eax, eax
|
||||
ret 4
|
||||
|
||||
; The default implementation of DISKFUNC.adjust_cache_size.
|
||||
disk_default_adjust_cache_size:
|
||||
mov eax, [esp+8]
|
||||
ret 8
|
||||
|
||||
; This is an internal function called from 'disk_media_changed' when a new media
|
||||
; is detected. It creates the list of partitions for the media.
|
||||
|
||||
; The default implementation of DISKFUNC.adjust_cache_size.
|
||||
disk_default_adjust_cache_size:
|
||||
mov eax, [esp+8]
|
||||
ret 8
|
||||
|
||||
; This is an internal function called from 'disk_media_changed' when a new media
|
||||
; is detected. It creates the list of partitions for the media.
|
||||
; If media is not partitioned, then the list consists of one partition which
|
||||
; covers all the media.
|
||||
; esi = pointer to the DISK structure.
|
||||
@ -974,53 +976,53 @@ disk_detect_partition:
|
||||
; with ebp-based frame arguments start from ebp+8, since [ebp]=saved ebp
|
||||
; and [ebp+4]=return address.
|
||||
virtual at ebp+8
|
||||
.start dq ?
|
||||
.length dq ?
|
||||
end virtual
|
||||
; When disk_add_partition is called, ebx contains a pointer to
|
||||
; a two-sectors-sized buffer. This function saves ebx in the stack
|
||||
; immediately before ebp.
|
||||
virtual at ebp-4
|
||||
.buffer dd ?
|
||||
end virtual
|
||||
; 1. Read the bootsector to the buffer.
|
||||
mov al, DISKFUNC.read
|
||||
mov ebx, [.buffer]
|
||||
add ebx, 512
|
||||
push 1
|
||||
stdcall disk_call_driver, ebx, dword [.start], dword [.start+4], esp
|
||||
; 2. Run tests for all supported filesystems. If at least one test succeeded,
|
||||
; go to 4.
|
||||
; For tests: qword [ebp+8] = partition start, qword [ebp+10h] = partition
|
||||
; length, [esp] = 0 if reading bootsector failed or 1 if succeeded,
|
||||
; ebx points to the buffer for bootsector.
|
||||
call fat_create_partition
|
||||
test eax, eax
|
||||
jnz .success
|
||||
; 3. No file system has recognized the volume, so just allocate the PARTITION
|
||||
; structure without extra fields.
|
||||
push sizeof.PARTITION
|
||||
pop eax
|
||||
call malloc
|
||||
test eax, eax
|
||||
jz .nothing
|
||||
mov edx, dword [.start]
|
||||
mov dword [eax+PARTITION.FirstSector], edx
|
||||
mov edx, dword [.start+4]
|
||||
.start dq ?
|
||||
.length dq ?
|
||||
end virtual
|
||||
; When disk_add_partition is called, ebx contains a pointer to
|
||||
; a two-sectors-sized buffer. This function saves ebx in the stack
|
||||
; immediately before ebp.
|
||||
virtual at ebp-4
|
||||
.buffer dd ?
|
||||
end virtual
|
||||
; 1. Read the bootsector to the buffer.
|
||||
mov al, DISKFUNC.read
|
||||
mov ebx, [.buffer]
|
||||
add ebx, 512
|
||||
push 1
|
||||
stdcall disk_call_driver, ebx, dword [.start], dword [.start+4], esp
|
||||
; 2. Run tests for all supported filesystems. If at least one test succeeded,
|
||||
; go to 4.
|
||||
; For tests: qword [ebp+8] = partition start, qword [ebp+10h] = partition
|
||||
; length, [esp] = 0 if reading bootsector failed or 1 if succeeded,
|
||||
; ebx points to the buffer for bootsector.
|
||||
call fat_create_partition
|
||||
test eax, eax
|
||||
jnz .success
|
||||
; 3. No file system has recognized the volume, so just allocate the PARTITION
|
||||
; structure without extra fields.
|
||||
push sizeof.PARTITION
|
||||
pop eax
|
||||
call malloc
|
||||
test eax, eax
|
||||
jz .nothing
|
||||
mov edx, dword [.start]
|
||||
mov dword [eax+PARTITION.FirstSector], edx
|
||||
mov edx, dword [.start+4]
|
||||
mov dword [eax+PARTITION.FirstSector+4], edx
|
||||
mov edx, dword [.length]
|
||||
mov dword [eax+PARTITION.Length], edx
|
||||
mov edx, dword [.length+4]
|
||||
mov dword [eax+PARTITION.Length+4], edx
|
||||
mov [eax+PARTITION.Disk], esi
|
||||
and [eax+PARTITION.FSUserFunctions], 0
|
||||
.success:
|
||||
.nothing:
|
||||
; 4. Return with eax = pointer to PARTITION or NULL.
|
||||
pop ecx
|
||||
ret
|
||||
|
||||
; This function is called from file_system_lfn.
|
||||
mov dword [eax+PARTITION.Length], edx
|
||||
mov edx, dword [.length+4]
|
||||
mov dword [eax+PARTITION.Length+4], edx
|
||||
mov [eax+PARTITION.Disk], esi
|
||||
and [eax+PARTITION.FSUserFunctions], 0
|
||||
.success:
|
||||
.nothing:
|
||||
; 4. Return with eax = pointer to PARTITION or NULL.
|
||||
pop ecx
|
||||
ret
|
||||
|
||||
; This function is called from file_system_lfn.
|
||||
; This handler gets the control each time when fn 70 is called
|
||||
; with unknown item of root subdirectory.
|
||||
; in: esi -> name
|
||||
@ -1082,13 +1084,13 @@ dyndisk_handler:
|
||||
; We found the addressed DISK structure.
|
||||
; 5. Reference the disk.
|
||||
lock inc [ebx+DISK.RefCount]
|
||||
; 6. Now we are sure that the DISK structure is not going to die at least
|
||||
; while we are working with it, so release the global mutex.
|
||||
call mutex_unlock
|
||||
pop ecx ; pop from the stack saved value of esi
|
||||
; 7. Acquire the mutex for media object.
|
||||
pop edi ; restore edi
|
||||
lea ecx, [ebx+DISK.MediaLock]
|
||||
; 6. Now we are sure that the DISK structure is not going to die at least
|
||||
; while we are working with it, so release the global mutex.
|
||||
call mutex_unlock
|
||||
pop ecx ; pop from the stack saved value of esi
|
||||
; 7. Acquire the mutex for media object.
|
||||
pop edi ; restore edi
|
||||
lea ecx, [ebx+DISK.MediaLock]
|
||||
call mutex_lock
|
||||
; 8. Get the media object. If it is not NULL, reference it.
|
||||
xor edx, edx
|
||||
@ -1197,50 +1199,50 @@ fs_dyndisk:
|
||||
pop edx edx edx eax ; edx = pointer to DISK, eax = NULL or edx
|
||||
test eax, eax
|
||||
jz .nomedia
|
||||
.main:
|
||||
cmp ecx, [edx+DISK.NumPartitions]
|
||||
jae .notfound
|
||||
mov eax, [edx+DISK.Partitions]
|
||||
mov eax, [eax+ecx*4]
|
||||
mov edi, [eax+PARTITION.FSUserFunctions]
|
||||
test edi, edi
|
||||
jz .nofs
|
||||
mov ecx, [ebx]
|
||||
cmp [edi], ecx
|
||||
jbe .unsupported
|
||||
push edx
|
||||
push ebp
|
||||
mov ebp, eax
|
||||
call dword [edi+4+ecx*4]
|
||||
pop ebp
|
||||
pop edx
|
||||
mov dword [esp+32], eax
|
||||
mov dword [esp+20], ebx
|
||||
.cleanup:
|
||||
mov esi, edx
|
||||
call disk_media_dereference
|
||||
call disk_dereference
|
||||
ret
|
||||
.nofs:
|
||||
mov dword [esp+32], ERROR_UNKNOWN_FS
|
||||
jmp .cleanup
|
||||
.notfound:
|
||||
mov dword [esp+32], ERROR_FILE_NOT_FOUND
|
||||
jmp .cleanup
|
||||
.unsupported:
|
||||
mov dword [esp+32], ERROR_UNSUPPORTED_FS
|
||||
jmp .cleanup
|
||||
.nomedia:
|
||||
test ecx, ecx
|
||||
jnz .notfound
|
||||
.main:
|
||||
cmp ecx, [edx+DISK.NumPartitions]
|
||||
jae .notfound
|
||||
mov eax, [edx+DISK.Partitions]
|
||||
mov eax, [eax+ecx*4]
|
||||
mov edi, [eax+PARTITION.FSUserFunctions]
|
||||
test edi, edi
|
||||
jz .nofs
|
||||
mov ecx, [ebx]
|
||||
cmp [edi], ecx
|
||||
jbe .unsupported
|
||||
push edx
|
||||
push ebp
|
||||
mov ebp, eax
|
||||
call dword [edi+4+ecx*4]
|
||||
pop ebp
|
||||
pop edx
|
||||
mov dword [esp+32], eax
|
||||
mov dword [esp+20], ebx
|
||||
.cleanup:
|
||||
mov esi, edx
|
||||
call disk_media_dereference
|
||||
call disk_dereference
|
||||
ret
|
||||
.nofs:
|
||||
mov dword [esp+32], ERROR_UNKNOWN_FS
|
||||
jmp .cleanup
|
||||
.notfound:
|
||||
mov dword [esp+32], ERROR_FILE_NOT_FOUND
|
||||
jmp .cleanup
|
||||
.unsupported:
|
||||
mov dword [esp+32], ERROR_UNSUPPORTED_FS
|
||||
jmp .cleanup
|
||||
.nomedia:
|
||||
test ecx, ecx
|
||||
jnz .notfound
|
||||
test byte [edx+DISK.DriverFlags], DISK_NO_INSERT_NOTIFICATION
|
||||
jz .deverror
|
||||
; if the driver does not support insert notifications and we are the only fs
|
||||
; operation with this disk, issue the fake insert notification; if media is
|
||||
; still not inserted, 'disk_media_changed' will detect this and do nothing
|
||||
lea ecx, [edx+DISK.MediaLock]
|
||||
call mutex_lock
|
||||
cmp [edx+DISK.MediaRefCount], 1
|
||||
; if the driver does not support insert notifications and we are the only fs
|
||||
; operation with this disk, issue the fake insert notification; if media is
|
||||
; still not inserted, 'disk_media_changed' will detect this and do nothing
|
||||
lea ecx, [edx+DISK.MediaLock]
|
||||
call mutex_lock
|
||||
cmp [edx+DISK.MediaRefCount], 1
|
||||
jnz .noluck
|
||||
call mutex_unlock
|
||||
push edx
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision: 2381 $
|
||||
|
||||
@ -15,17 +15,17 @@ $Revision: 2381 $
|
||||
; out: eax = error code; 0 = ok
|
||||
fs_read32_sys:
|
||||
; Compatibility hack: if PARTITION.Disk is 'old', there is no DISK structure,
|
||||
; this request should be processed by hd_read.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 0
|
||||
call hd_read
|
||||
mov [hdd_appl_data], 1 ; restore to default state
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to SysCache and let the common part
|
||||
; this request should be processed by hd_read.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 0
|
||||
call hd_read
|
||||
mov [hdd_appl_data], 1 ; restore to default state
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to SysCache and let the common part
|
||||
; do its work.
|
||||
push ecx
|
||||
mov ecx, [ebp+PARTITION.Disk]
|
||||
@ -40,17 +40,17 @@ fs_read32_sys:
|
||||
; out: eax = error code; 0 = ok
|
||||
fs_read32_app:
|
||||
; Compatibility hack: if PARTITION.Disk is 'old', there is no DISK structure,
|
||||
; this request should be processed by hd_read.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 1
|
||||
call hd_read
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to AppCache and let the common part
|
||||
; do its work.
|
||||
; this request should be processed by hd_read.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 1
|
||||
call hd_read
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to AppCache and let the common part
|
||||
; do its work.
|
||||
push ecx
|
||||
mov ecx, [ebp+PARTITION.Disk]
|
||||
add ecx, DISK.AppCache
|
||||
@ -65,34 +65,34 @@ fs_read32_common:
|
||||
ja @f
|
||||
mov eax, DISK_STATUS_END_OF_MEDIA
|
||||
pop ecx
|
||||
ret
|
||||
@@:
|
||||
; 2. Get the absolute sector on the disk.
|
||||
push edx esi
|
||||
xor edx, edx
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
adc edx, dword [ebp+PARTITION.FirstSector+4]
|
||||
ret
|
||||
@@:
|
||||
; 2. Get the absolute sector on the disk.
|
||||
push edx esi
|
||||
xor edx, edx
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
adc edx, dword [ebp+PARTITION.FirstSector+4]
|
||||
; 3. If there is no cache for this disk, just pass the request to the driver.
|
||||
cmp [ecx+DISKCACHE.pointer], 0
|
||||
jnz .scancache
|
||||
push 1
|
||||
push esp ; numsectors
|
||||
push edx ; startsector
|
||||
push eax ; startsector
|
||||
push ebx ; buffer
|
||||
mov esi, [ebp+PARTITION.Disk]
|
||||
mov al, DISKFUNC.read
|
||||
call disk_call_driver
|
||||
pop ecx
|
||||
pop esi edx
|
||||
pop ecx
|
||||
ret
|
||||
.scancache:
|
||||
; 4. Scan the cache.
|
||||
push edi ecx ; scan cache
|
||||
push edx eax
|
||||
virtual at esp
|
||||
.sector_lo dd ?
|
||||
push edx ; startsector
|
||||
push eax ; startsector
|
||||
push ebx ; buffer
|
||||
mov esi, [ebp+PARTITION.Disk]
|
||||
mov al, DISKFUNC.read
|
||||
call disk_call_driver
|
||||
pop ecx
|
||||
pop esi edx
|
||||
pop ecx
|
||||
ret
|
||||
.scancache:
|
||||
; 4. Scan the cache.
|
||||
push edi ecx ; scan cache
|
||||
push edx eax
|
||||
virtual at esp
|
||||
.sector_lo dd ?
|
||||
.sector_hi dd ?
|
||||
.cache dd ?
|
||||
end virtual
|
||||
@ -132,13 +132,13 @@ end virtual
|
||||
jnz .read_done
|
||||
|
||||
push 1
|
||||
push esp
|
||||
push edx
|
||||
push [.sector_lo+12]
|
||||
mov ecx, [.cache+16]
|
||||
mov eax, edi
|
||||
shl eax, 9
|
||||
add eax, [ecx+DISKCACHE.data]
|
||||
push esp
|
||||
push edx
|
||||
push [.sector_lo+12]
|
||||
mov ecx, [.cache+16]
|
||||
mov eax, edi
|
||||
shl eax, 9
|
||||
add eax, [ecx+DISKCACHE.data]
|
||||
push eax
|
||||
mov esi, [ebp+PARTITION.Disk]
|
||||
mov al, DISKFUNC.read
|
||||
@ -186,17 +186,17 @@ end virtual
|
||||
; out: eax = error code; 0 = ok
|
||||
fs_write32_sys:
|
||||
; Compatibility hack: if PARTITION.Disk is 'old', there is no DISK structure,
|
||||
; this request should be processed by hd_write.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 0
|
||||
call hd_write
|
||||
mov [hdd_appl_data], 1 ; restore to default state
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to SysCache and let the common part
|
||||
; this request should be processed by hd_write.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 0
|
||||
call hd_write
|
||||
mov [hdd_appl_data], 1 ; restore to default state
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to SysCache and let the common part
|
||||
; do its work.
|
||||
push ecx
|
||||
mov ecx, [ebp+PARTITION.Disk]
|
||||
@ -211,17 +211,17 @@ fs_write32_sys:
|
||||
; out: eax = error code; 0 = ok
|
||||
fs_write32_app:
|
||||
; Compatibility hack: if PARTITION.Disk is 'old', there is no DISK structure,
|
||||
; this request should be processed by hd_write.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 1
|
||||
call hd_write
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to AppCache and let the common part
|
||||
; do its work.
|
||||
; this request should be processed by hd_write.
|
||||
cmp [ebp+PARTITION.Disk], 'old'
|
||||
jnz @f
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
mov [hdd_appl_data], 1
|
||||
call hd_write
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; In the normal case, save ecx, set ecx to AppCache and let the common part
|
||||
; do its work.
|
||||
push ecx
|
||||
mov ecx, [ebp+PARTITION.Disk]
|
||||
add ecx, DISK.AppCache
|
||||
@ -235,35 +235,35 @@ fs_write32_common:
|
||||
cmp dword [ebp+PARTITION.Length], eax
|
||||
ja @f
|
||||
mov eax, DISK_STATUS_END_OF_MEDIA
|
||||
pop ecx
|
||||
ret
|
||||
@@:
|
||||
push edx esi
|
||||
; 2. Get the absolute sector on the disk.
|
||||
xor edx, edx
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
pop ecx
|
||||
ret
|
||||
@@:
|
||||
push edx esi
|
||||
; 2. Get the absolute sector on the disk.
|
||||
xor edx, edx
|
||||
add eax, dword [ebp+PARTITION.FirstSector]
|
||||
adc edx, dword [ebp+PARTITION.FirstSector+4]
|
||||
; 3. If there is no cache for this disk, just pass request to the driver.
|
||||
cmp [ecx+DISKCACHE.pointer], 0
|
||||
jnz .scancache
|
||||
push 1
|
||||
push esp ; numsectors
|
||||
push edx ; startsector
|
||||
push eax ; startsector
|
||||
push ebx ; buffer
|
||||
mov esi, [ebp+PARTITION.Disk]
|
||||
mov al, DISKFUNC.write
|
||||
call disk_call_driver
|
||||
pop ecx
|
||||
pop esi edx
|
||||
pop ecx
|
||||
ret
|
||||
.scancache:
|
||||
; 4. Scan the cache.
|
||||
push edi ecx ; scan cache
|
||||
push edx eax
|
||||
virtual at esp
|
||||
.sector_lo dd ?
|
||||
push edx ; startsector
|
||||
push eax ; startsector
|
||||
push ebx ; buffer
|
||||
mov esi, [ebp+PARTITION.Disk]
|
||||
mov al, DISKFUNC.write
|
||||
call disk_call_driver
|
||||
pop ecx
|
||||
pop esi edx
|
||||
pop ecx
|
||||
ret
|
||||
.scancache:
|
||||
; 4. Scan the cache.
|
||||
push edi ecx ; scan cache
|
||||
push edx eax
|
||||
virtual at esp
|
||||
.sector_lo dd ?
|
||||
.sector_hi dd ?
|
||||
.cache dd ?
|
||||
end virtual
|
||||
@ -314,13 +314,13 @@ end virtual
|
||||
mov edx, [.sector_hi]
|
||||
mov [esi], eax ; sector number
|
||||
mov [esi+4], edx ; sector number
|
||||
|
||||
.yes_in_cache_write:
|
||||
|
||||
mov dword [esi+8], 2 ; write - differs from hd
|
||||
|
||||
shl edi, 9
|
||||
mov ecx, [.cache]
|
||||
|
||||
.yes_in_cache_write:
|
||||
|
||||
mov dword [esi+8], 2 ; write - differs from hd
|
||||
|
||||
shl edi, 9
|
||||
mov ecx, [.cache]
|
||||
add edi, [ecx+DISKCACHE.data]
|
||||
|
||||
mov esi, ebx
|
||||
@ -357,31 +357,31 @@ find_empty_slot64:
|
||||
shl eax, 2
|
||||
add eax, [esi+DISKCACHE.pointer]
|
||||
cmp dword [eax+8], 2
|
||||
jb .found_slot ; it's empty or read
|
||||
dec ecx
|
||||
jnz .search_for_empty
|
||||
stdcall write_cache64, [ebp+PARTITION.Disk] ; no empty slots found, write all
|
||||
test eax, eax
|
||||
jne .found_slot_access_denied
|
||||
jmp .search_again ; and start again
|
||||
jb .found_slot ; it's empty or read
|
||||
dec ecx
|
||||
jnz .search_for_empty
|
||||
stdcall write_cache64, [ebp+PARTITION.Disk] ; no empty slots found, write all
|
||||
test eax, eax
|
||||
jne .found_slot_access_denied
|
||||
jmp .search_again ; and start again
|
||||
.found_slot:
|
||||
mov [esi+DISKCACHE.search_start], edi
|
||||
xor eax, eax ; success
|
||||
.found_slot_access_denied:
|
||||
ret
|
||||
|
||||
; This function is intended to replace the old 'write_cache' function.
|
||||
proc write_cache64 uses ecx edx esi edi, disk:dword
|
||||
locals
|
||||
cache_chain_started dd 0
|
||||
cache_chain_size dd ?
|
||||
cache_chain_pos dd ?
|
||||
cache_chain_ptr dd ?
|
||||
endl
|
||||
saved_esi_pos = 16+12 ; size of local variables + size of registers before esi
|
||||
; If there is no cache for this disk, nothing to do.
|
||||
cmp [esi+DISKCACHE.pointer], 0
|
||||
jz .flush
|
||||
ret
|
||||
|
||||
; This function is intended to replace the old 'write_cache' function.
|
||||
proc write_cache64 uses ecx edx esi edi, disk:dword
|
||||
locals
|
||||
cache_chain_started dd 0
|
||||
cache_chain_size dd ?
|
||||
cache_chain_pos dd ?
|
||||
cache_chain_ptr dd ?
|
||||
endl
|
||||
saved_esi_pos = 16+12 ; size of local variables + size of registers before esi
|
||||
; If there is no cache for this disk, nothing to do.
|
||||
cmp [esi+DISKCACHE.pointer], 0
|
||||
jz .flush
|
||||
;-----------------------------------------------------------
|
||||
; write all changed sectors to disk
|
||||
;-----------------------------------------------------------
|
||||
@ -442,13 +442,13 @@ saved_esi_pos = 16+12 ; size of local variables + size of registers before esi
|
||||
dec ecx
|
||||
jnz .write_cache_more
|
||||
call .flush_cache_chain
|
||||
test eax, eax
|
||||
jnz .nothing
|
||||
.flush:
|
||||
mov esi, [disk]
|
||||
mov al, DISKFUNC.flush
|
||||
call disk_call_driver
|
||||
.nothing:
|
||||
test eax, eax
|
||||
jnz .nothing
|
||||
.flush:
|
||||
mov esi, [disk]
|
||||
mov al, DISKFUNC.flush
|
||||
call disk_call_driver
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
.flush_cache_chain:
|
||||
@ -463,13 +463,13 @@ saved_esi_pos = 16+12 ; size of local variables + size of registers before esi
|
||||
.write_cache_sector:
|
||||
mov [cache_chain_size], 1
|
||||
mov [cache_chain_pos], edi
|
||||
.write_cache_chain:
|
||||
pusha
|
||||
mov edi, [cache_chain_pos]
|
||||
mov ecx, [ebp-saved_esi_pos]
|
||||
shl edi, 9
|
||||
add edi, [ecx+DISKCACHE.data]
|
||||
mov ecx, [cache_chain_size]
|
||||
.write_cache_chain:
|
||||
pusha
|
||||
mov edi, [cache_chain_pos]
|
||||
mov ecx, [ebp-saved_esi_pos]
|
||||
shl edi, 9
|
||||
add edi, [ecx+DISKCACHE.data]
|
||||
mov ecx, [cache_chain_size]
|
||||
push ecx
|
||||
push esp ; numsectors
|
||||
mov eax, [cache_chain_ptr]
|
||||
@ -547,13 +547,13 @@ disk_init_cache:
|
||||
imul eax, 7
|
||||
mov [esi+DISK.AppCache.data_size], eax
|
||||
mov [esi+DISK.AppCache.pointer], edx
|
||||
|
||||
mov eax, [esi+DISK.SysCache.data_size]
|
||||
push ebx
|
||||
call calculate_for_hd64
|
||||
pop ebx
|
||||
add eax, [esi+DISK.SysCache.pointer]
|
||||
mov [esi+DISK.SysCache.data], eax
|
||||
|
||||
mov eax, [esi+DISK.SysCache.data_size]
|
||||
push ebx
|
||||
call calculate_for_hd64
|
||||
pop ebx
|
||||
add eax, [esi+DISK.SysCache.pointer]
|
||||
mov [esi+DISK.SysCache.data], eax
|
||||
mov [esi+DISK.SysCache.sad_size], ecx
|
||||
|
||||
push edi
|
||||
@ -562,13 +562,13 @@ disk_init_cache:
|
||||
xor eax, eax
|
||||
rep stosd
|
||||
pop edi
|
||||
|
||||
mov eax, [esi+DISK.AppCache.data_size]
|
||||
push ebx
|
||||
call calculate_for_hd64
|
||||
pop ebx
|
||||
add eax, [esi+DISK.AppCache.pointer]
|
||||
mov [esi+DISK.AppCache.data], eax
|
||||
|
||||
mov eax, [esi+DISK.AppCache.data_size]
|
||||
push ebx
|
||||
call calculate_for_hd64
|
||||
pop ebx
|
||||
add eax, [esi+DISK.AppCache.pointer]
|
||||
mov [esi+DISK.AppCache.data], eax
|
||||
mov [esi+DISK.AppCache.sad_size], ecx
|
||||
|
||||
push edi
|
||||
@ -588,56 +588,58 @@ disk_init_cache:
|
||||
.nocache:
|
||||
mov [esi+DISK.SysCache.pointer], eax
|
||||
mov [esi+DISK.AppCache.pointer], eax
|
||||
mov al, 1
|
||||
ret
|
||||
|
||||
calculate_for_hd64:
|
||||
push eax
|
||||
mov ebx, eax
|
||||
shr eax, 9
|
||||
lea eax, [eax*3]
|
||||
shl eax, 2
|
||||
sub ebx, eax
|
||||
shr ebx, 9
|
||||
mov ecx, ebx
|
||||
shl ebx, 9
|
||||
pop eax
|
||||
sub eax, ebx
|
||||
dec ecx
|
||||
ret
|
||||
|
||||
|
||||
; This internal function is called from disk_media_dereference to free the
|
||||
; allocated cache, if there is one.
|
||||
; esi = pointer to DISK structure
|
||||
mov al, 1
|
||||
ret
|
||||
|
||||
calculate_for_hd64:
|
||||
push eax
|
||||
mov ebx, eax
|
||||
shr eax, 9
|
||||
lea eax, [eax*3]
|
||||
shl eax, 2
|
||||
sub ebx, eax
|
||||
shr ebx, 9
|
||||
mov ecx, ebx
|
||||
shl ebx, 9
|
||||
pop eax
|
||||
sub eax, ebx
|
||||
dec ecx
|
||||
ret
|
||||
|
||||
|
||||
; This internal function is called from disk_media_dereference to free the
|
||||
; allocated cache, if there is one.
|
||||
; esi = pointer to DISK structure
|
||||
disk_free_cache:
|
||||
; The algorithm is straightforward.
|
||||
mov eax, [esi+DISK.SysCache.pointer]
|
||||
test eax, eax
|
||||
jz .nothing
|
||||
stdcall kernel_free, eax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
; This function flushes all modified data from both caches for the given DISK.
|
||||
; esi = pointer to DISK
|
||||
disk_sync:
|
||||
; Compatibility hack: if PARTITION.Disk is 'old', there is no DISK structure,
|
||||
; this request should be processed by write_cache.
|
||||
cmp esi, 'old'
|
||||
jnz @f
|
||||
mov [hdd_appl_data], 0
|
||||
call write_cache
|
||||
mov [hdd_appl_data], 1
|
||||
jmp write_cache
|
||||
@@:
|
||||
; The algorithm is straightforward.
|
||||
push esi
|
||||
push esi ; for second write_cache64
|
||||
push esi ; for first write_cache64
|
||||
add esi, DISK.SysCache
|
||||
call write_cache64
|
||||
add esi, DISK.AppCache - DISK.SysCache
|
||||
call write_cache64
|
||||
pop esi
|
||||
ret
|
||||
stdcall kernel_free, eax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
; This function flushes all modified data from both caches for the given DISK.
|
||||
; esi = pointer to DISK
|
||||
disk_sync:
|
||||
; Compatibility hack: if PARTITION.Disk is 'old', there is no DISK structure,
|
||||
; this request should be processed by write_cache.
|
||||
cmp esi, 'old'
|
||||
jnz @f
|
||||
mov [hdd_appl_data], 0
|
||||
call write_cache
|
||||
mov [hdd_appl_data], 1
|
||||
call write_cache
|
||||
mov eax, [hd_error]
|
||||
ret
|
||||
@@:
|
||||
; The algorithm is straightforward.
|
||||
push esi
|
||||
push esi ; for second write_cache64
|
||||
push esi ; for first write_cache64
|
||||
add esi, DISK.SysCache
|
||||
call write_cache64
|
||||
add esi, DISK.AppCache - DISK.SysCache
|
||||
call write_cache64
|
||||
pop esi
|
||||
ret
|
||||
|
@ -340,7 +340,11 @@ hd_timeout_error:
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_timeout_str
|
||||
; call sys_msg_board_str
|
||||
if lang eq sp
|
||||
DEBUGF 1,"K : FS - HD tiempo de espera agotado\n"
|
||||
else
|
||||
DEBUGF 1,"K : FS - HD timeout\n"
|
||||
end if
|
||||
|
||||
mov [hd_error], 1
|
||||
pop eax
|
||||
@ -352,7 +356,11 @@ hd_read_error:
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_read_str
|
||||
; call sys_msg_board_str
|
||||
if lang eq sp
|
||||
DEBUGF 1,"K : FS - HD error de lectura\n"
|
||||
else
|
||||
DEBUGF 1,"K : FS - HD read error\n"
|
||||
end if
|
||||
pop edx eax
|
||||
ret
|
||||
|
||||
@ -362,7 +370,11 @@ hd_write_error:
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_write_str
|
||||
; call sys_msg_board_str
|
||||
if lang eq sp
|
||||
DEBUGF 1,"K : FS - HD error de escritura\n"
|
||||
else
|
||||
DEBUGF 1,"K : FS - HD write error\n"
|
||||
end if
|
||||
ret
|
||||
|
||||
hd_write_error_dma:
|
||||
@ -370,7 +382,11 @@ hd_write_error_dma:
|
||||
; call clear_application_table_status
|
||||
; mov esi, hd_write_str
|
||||
; call sys_msg_board_str
|
||||
DEBUGF 1,"K : FS - HD read error\n"
|
||||
if lang eq sp
|
||||
DEBUGF 1,"K : FS - HD error de escritura\n"
|
||||
else
|
||||
DEBUGF 1,"K : FS - HD write error\n"
|
||||
end if
|
||||
pop esi
|
||||
ret
|
||||
|
||||
@ -379,7 +395,11 @@ hd_lba_error:
|
||||
; call clear_application_table_status
|
||||
; mov esi,hd_lba_str
|
||||
; call sys_msg_board_str
|
||||
if lang eq sp
|
||||
DEBUGF 1,"K : FS - HD error en LBA\n"
|
||||
else
|
||||
DEBUGF 1,"K : FS - HD LBA error\n"
|
||||
end if
|
||||
jmp LBA_read_ret
|
||||
|
||||
|
||||
@ -942,86 +962,86 @@ int13_call:
|
||||
test byte [int13_regs_out+v86_regs.eflags], 1
|
||||
jnz @f
|
||||
mov edx, ecx
|
||||
@@:
|
||||
ret
|
||||
; \end{diamond}
|
||||
|
||||
reserve_hd1:
|
||||
|
||||
cli
|
||||
cmp [hd1_status], 0
|
||||
je reserve_ok1
|
||||
|
||||
sti
|
||||
call change_task
|
||||
jmp reserve_hd1
|
||||
|
||||
reserve_ok1:
|
||||
|
||||
push eax
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 5
|
||||
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
|
||||
mov [hd1_status], eax
|
||||
pop eax
|
||||
sti
|
||||
ret
|
||||
;********************************************
|
||||
|
||||
uglobal
|
||||
hd_in_cache db ?
|
||||
endg
|
||||
|
||||
reserve_hd_channel:
|
||||
; BIOS disk accesses are protected with common mutex hd1_status
|
||||
; This must be modified when hd1_status will not be valid!
|
||||
cmp [hdpos], 0x80
|
||||
jae .ret
|
||||
cmp [hdbase], 0x1F0
|
||||
jne .IDE_Channel_2
|
||||
.IDE_Channel_1:
|
||||
cli
|
||||
cmp [IDE_Channel_1], 0
|
||||
je .reserve_ok_1
|
||||
sti
|
||||
call change_task
|
||||
jmp .IDE_Channel_1
|
||||
.IDE_Channel_2:
|
||||
cli
|
||||
cmp [IDE_Channel_2], 0
|
||||
je .reserve_ok_2
|
||||
sti
|
||||
call change_task
|
||||
jmp .IDE_Channel_2
|
||||
.reserve_ok_1:
|
||||
mov [IDE_Channel_1], 1
|
||||
push eax
|
||||
mov al, 1
|
||||
jmp @f
|
||||
.reserve_ok_2:
|
||||
mov [IDE_Channel_2], 1
|
||||
push eax
|
||||
mov al, 3
|
||||
@@:
|
||||
cmp [hdid], 1
|
||||
sbb al, -1
|
||||
mov [hd_in_cache], al
|
||||
pop eax
|
||||
sti
|
||||
.ret:
|
||||
ret
|
||||
|
||||
free_hd_channel:
|
||||
; see comment at reserve_hd_channel
|
||||
cmp [hdpos], 0x80
|
||||
jae .ret
|
||||
cmp [hdbase], 0x1F0
|
||||
jne .IDE_Channel_2
|
||||
.IDE_Channel_1:
|
||||
mov [IDE_Channel_1], 0
|
||||
.ret:
|
||||
ret
|
||||
.IDE_Channel_2:
|
||||
mov [IDE_Channel_2], 0
|
||||
ret
|
||||
;********************************************
|
||||
@@:
|
||||
ret
|
||||
; \end{diamond}
|
||||
|
||||
reserve_hd1:
|
||||
|
||||
cli
|
||||
cmp [hd1_status], 0
|
||||
je reserve_ok1
|
||||
|
||||
sti
|
||||
call change_task
|
||||
jmp reserve_hd1
|
||||
|
||||
reserve_ok1:
|
||||
|
||||
push eax
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 5
|
||||
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
|
||||
mov [hd1_status], eax
|
||||
pop eax
|
||||
sti
|
||||
ret
|
||||
;********************************************
|
||||
|
||||
uglobal
|
||||
hd_in_cache db ?
|
||||
endg
|
||||
|
||||
reserve_hd_channel:
|
||||
; BIOS disk accesses are protected with common mutex hd1_status
|
||||
; This must be modified when hd1_status will not be valid!
|
||||
cmp [hdpos], 0x80
|
||||
jae .ret
|
||||
cmp [hdbase], 0x1F0
|
||||
jne .IDE_Channel_2
|
||||
.IDE_Channel_1:
|
||||
cli
|
||||
cmp [IDE_Channel_1], 0
|
||||
je .reserve_ok_1
|
||||
sti
|
||||
call change_task
|
||||
jmp .IDE_Channel_1
|
||||
.IDE_Channel_2:
|
||||
cli
|
||||
cmp [IDE_Channel_2], 0
|
||||
je .reserve_ok_2
|
||||
sti
|
||||
call change_task
|
||||
jmp .IDE_Channel_2
|
||||
.reserve_ok_1:
|
||||
mov [IDE_Channel_1], 1
|
||||
push eax
|
||||
mov al, 1
|
||||
jmp @f
|
||||
.reserve_ok_2:
|
||||
mov [IDE_Channel_2], 1
|
||||
push eax
|
||||
mov al, 3
|
||||
@@:
|
||||
cmp [hdid], 1
|
||||
sbb al, -1
|
||||
mov [hd_in_cache], al
|
||||
pop eax
|
||||
sti
|
||||
.ret:
|
||||
ret
|
||||
|
||||
free_hd_channel:
|
||||
; see comment at reserve_hd_channel
|
||||
cmp [hdpos], 0x80
|
||||
jae .ret
|
||||
cmp [hdbase], 0x1F0
|
||||
jne .IDE_Channel_2
|
||||
.IDE_Channel_1:
|
||||
mov [IDE_Channel_1], 0
|
||||
.ret:
|
||||
ret
|
||||
.IDE_Channel_2:
|
||||
mov [IDE_Channel_2], 0
|
||||
ret
|
||||
;********************************************
|
||||
|
@ -134,12 +134,12 @@ found_slot:
|
||||
call calculate_cache_5
|
||||
found_slot_access_denied:
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
clear_hd_cache:
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
clear_hd_cache:
|
||||
ret
|
||||
;--------------------------------------------------------------------
|
||||
align 4
|
||||
calculate_cache:
|
||||
; mov ecx,cache_max ; entries in cache
|
||||
; mov esi,HD_CACHE+8
|
||||
|
@ -24,7 +24,7 @@ sysfn_saveramdisk: ; 18.6 = SAVE FLOPPY IMAGE (HD version only)
|
||||
mov ebx, saverd_fileinfo
|
||||
mov [saverd_fileinfo.name], ecx
|
||||
pushad
|
||||
call file_system_lfn ;in ebx
|
||||
call file_system_lfn_protected ;in ebx
|
||||
popad
|
||||
mov [esp+32], eax
|
||||
ret
|
||||
|
@ -42,7 +42,7 @@ printplain:
|
||||
@@:
|
||||
call putchar
|
||||
lodsb
|
||||
test al,al
|
||||
test al, al
|
||||
jnz @b
|
||||
popa
|
||||
ret
|
||||
@ -91,6 +91,7 @@ boot_read_floppy:
|
||||
inc si
|
||||
cmp si, 10
|
||||
jb @b
|
||||
sayerr_badsect:
|
||||
mov si, badsect
|
||||
sayerr_plain:
|
||||
call printplain
|
||||
@ -110,18 +111,18 @@ sayerr_plain:
|
||||
; dh - head number
|
||||
conv_abs_to_THS:
|
||||
push bx
|
||||
mov bx,word [BPB_SecPerTrk]
|
||||
xor dx,dx
|
||||
mov bx, word [BPB_SecPerTrk]
|
||||
xor dx, dx
|
||||
div bx
|
||||
inc dx
|
||||
mov cl, dl ; cl = sector number
|
||||
mov bx,word [BPB_NumHeads]
|
||||
xor dx,dx
|
||||
mov bx, word [BPB_NumHeads]
|
||||
xor dx, dx
|
||||
div bx
|
||||
; !!!!!!! ax = track number, dx = head number
|
||||
mov ch,al ; ch=track number
|
||||
xchg dh,dl ; dh=head number
|
||||
mov dl,0 ; dl=0 (drive 0 (a:))
|
||||
mov ch, al ; ch=track number
|
||||
xchg dh, dl ; dh=head number
|
||||
mov dl, 0 ; dl=0 (drive 0 (a:))
|
||||
pop bx
|
||||
retn
|
||||
; needed variables
|
||||
@ -145,8 +146,119 @@ FirstDataSector dw 0 ; begin of data
|
||||
;=========================================================================
|
||||
|
||||
include 'bootvesa.inc' ;Include source for boot vesa
|
||||
if defined extended_primary_loader
|
||||
include 'parsers.inc'
|
||||
end if
|
||||
|
||||
start_of_code:
|
||||
|
||||
if defined extended_primary_loader
|
||||
; save data from primary loader
|
||||
mov word [cs:bootcallback], si
|
||||
mov word [cs:bootcallback+2], ds
|
||||
push cs
|
||||
pop ds
|
||||
mov [bootdevice], ax
|
||||
mov [bootfs], bx
|
||||
|
||||
; set up stack
|
||||
mov ax, 3000h
|
||||
mov ss, ax
|
||||
mov sp, 0EC00h
|
||||
|
||||
; try to load configuration file
|
||||
mov ax, 1
|
||||
mov di, config_file_struct
|
||||
call [bootcallback]
|
||||
cld
|
||||
push cs
|
||||
pop es
|
||||
; bx=0 - ok, bx=1 - part of file loaded, assume this is ok
|
||||
cmp bx, 1
|
||||
ja .config_bad
|
||||
; configuration file was loaded, parse
|
||||
; if length is too big, use first 0FFFFh bytes
|
||||
test dx, dx
|
||||
jz @f
|
||||
mov ax, 0FFFFh
|
||||
@@:
|
||||
; ds:si will be pointer to current data, dx = limit
|
||||
xchg ax, dx
|
||||
push 4000h
|
||||
pop ds
|
||||
xor si, si
|
||||
.parse_loop:
|
||||
; skip spaces
|
||||
cmp si, dx
|
||||
jae .parse_done
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jbe .parse_loop
|
||||
dec si
|
||||
; loop over all possible configuration values
|
||||
mov bx, config_file_variables
|
||||
.find_variant:
|
||||
; get length
|
||||
mov cx, [es:bx]
|
||||
; zero length = end of list
|
||||
jecxz .find_newline
|
||||
; skip over length
|
||||
inc bx
|
||||
inc bx
|
||||
mov di, bx
|
||||
; skip over string
|
||||
add bx, cx
|
||||
; test whether we have at least cx symbols left
|
||||
mov ax, cx
|
||||
add ax, si
|
||||
jc .next_variant1
|
||||
cmp ax, dx
|
||||
jae .next_variant1
|
||||
; save current position
|
||||
push si
|
||||
; compare strings
|
||||
repz cmpsb
|
||||
jnz .next_variant2
|
||||
; strings are equal; look for "=" with possible spaces before and after
|
||||
@@:
|
||||
cmp si, dx
|
||||
jae .next_variant2
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jbe @b
|
||||
cmp al, '='
|
||||
jnz .next_variant2
|
||||
; ok, we found the true variant
|
||||
; ignore saved position on the stack
|
||||
pop ax
|
||||
; call the parser
|
||||
call word [es:bx]
|
||||
; line parsed, find next
|
||||
.find_newline:
|
||||
cmp si, dx
|
||||
jae .parse_done
|
||||
lodsb
|
||||
cmp al, 13
|
||||
jz .parse_loop
|
||||
cmp al, 10
|
||||
jz .parse_loop
|
||||
jmp .find_newline
|
||||
.next_variant2:
|
||||
; continue to the next variant, restoring current position
|
||||
pop si
|
||||
.next_variant1:
|
||||
; continue to the next variant
|
||||
; skip over the parser
|
||||
inc bx
|
||||
inc bx
|
||||
jmp .find_variant
|
||||
.parse_done:
|
||||
.config_bad:
|
||||
|
||||
; set up segment registers
|
||||
push cs
|
||||
pop ds
|
||||
else
|
||||
cld
|
||||
; \begin{diamond}[02.12.2005]
|
||||
; if bootloader sets ax = 'KL', then ds:si points to loader block
|
||||
@ -161,7 +273,7 @@ start_of_code:
|
||||
; (see comment to bx_from_load)
|
||||
cmp cx, 'HA'
|
||||
jnz no_hd_load
|
||||
cmp dx,'RD'
|
||||
cmp dx, 'RD'
|
||||
jnz no_hd_load
|
||||
mov word [cs:bx_from_load], bx ; {SPraid}[13.03.2007]
|
||||
no_hd_load:
|
||||
@ -175,6 +287,7 @@ no_hd_load:
|
||||
pop ds
|
||||
push cs
|
||||
pop es
|
||||
end if
|
||||
|
||||
; set videomode
|
||||
mov ax, 3
|
||||
@ -378,6 +491,7 @@ wait_loop: ; variant 2
|
||||
apm_end:
|
||||
_setcursor d80x25_top_num, 0
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
;CHECK current of code
|
||||
cmp [cfgmanager.loader_block], -1
|
||||
jz noloaderblock
|
||||
@ -387,12 +501,13 @@ apm_end:
|
||||
jnz sayerr
|
||||
push 0
|
||||
pop es
|
||||
end if
|
||||
|
||||
noloaderblock:
|
||||
; DISPLAY VESA INFORMATION
|
||||
call print_vesa_info
|
||||
call calc_vmodes_table
|
||||
call check_first_parm ;check and enable cursor_pos
|
||||
call print_vesa_info
|
||||
call calc_vmodes_table
|
||||
call check_first_parm ;check and enable cursor_pos
|
||||
|
||||
; \begin{diamond}[30.11.2005]
|
||||
cfgmanager:
|
||||
@ -404,7 +519,9 @@ cfgmanager:
|
||||
; d) preboot_device = from what boot?
|
||||
|
||||
; determine default settings
|
||||
if ~ defined extended_primary_loader
|
||||
mov [.bSettingsChanged], 0
|
||||
end if
|
||||
|
||||
;.preboot_gr_end:
|
||||
mov di, preboot_device
|
||||
@ -412,6 +529,12 @@ cfgmanager:
|
||||
; set it to use this preloaded image
|
||||
cmp byte [di], 0
|
||||
jnz .preboot_device_inited
|
||||
if defined extended_primary_loader
|
||||
inc byte [di]
|
||||
cmp byte [bootdevice], 'f' ; floppy?
|
||||
jz .preboot_device_inited
|
||||
inc byte [di]
|
||||
else
|
||||
cmp [.loader_block], -1
|
||||
jz @f
|
||||
les bx, [.loader_block]
|
||||
@ -422,17 +545,18 @@ cfgmanager:
|
||||
@@:
|
||||
; otherwise, set [preboot_device] to 1 (default value - boot from floppy)
|
||||
mov byte [di], 1
|
||||
end if
|
||||
.preboot_device_inited:
|
||||
; following 4 lines set variables to 1 if its current value is 0
|
||||
cmp byte [di+preboot_dma-preboot_device], 1
|
||||
adc byte [di+preboot_dma-preboot_device], 0
|
||||
cmp byte [di+preboot_biosdisk-preboot_device], 1
|
||||
adc byte [di+preboot_biosdisk-preboot_device], 0
|
||||
; default value for VRR is OFF
|
||||
cmp byte [di+preboot_vrrm-preboot_device], 0
|
||||
jnz @f
|
||||
mov byte [di+preboot_vrrm-preboot_device], 2
|
||||
@@:
|
||||
;; default value for VRR is OFF
|
||||
; cmp byte [di+preboot_vrrm-preboot_device], 0
|
||||
; jnz @f
|
||||
; mov byte [di+preboot_vrrm-preboot_device], 2
|
||||
;@@:
|
||||
; notify user
|
||||
_setcursor 5,2
|
||||
|
||||
@ -455,18 +579,22 @@ cfgmanager:
|
||||
mov si, curvideo_msg
|
||||
call print
|
||||
|
||||
call draw_current_vmode
|
||||
call draw_current_vmode
|
||||
|
||||
mov si, usebd_msg
|
||||
cmp [preboot_biosdisk], 1
|
||||
call .say_on_off
|
||||
mov si, vrrm_msg
|
||||
cmp [preboot_vrrm], 1
|
||||
call .say_on_off
|
||||
; mov si, vrrm_msg
|
||||
; cmp [preboot_vrrm], 1
|
||||
; call .say_on_off
|
||||
mov si, preboot_device_msg
|
||||
call print
|
||||
mov al, [preboot_device]
|
||||
if defined extended_primary_loader
|
||||
and eax, 3
|
||||
else
|
||||
and eax, 7
|
||||
end if
|
||||
mov si, [preboot_device_msgs+eax*2]
|
||||
call printplain
|
||||
.show_remarks:
|
||||
@ -502,14 +630,14 @@ cfgmanager:
|
||||
push dword [es:8*4]
|
||||
pop dword [.oldtimer]
|
||||
push dword [.timer]
|
||||
pop dword [es:8*4]
|
||||
pop dword [es:8*4]
|
||||
; mov eax, [es:8*4]
|
||||
; mov [.oldtimer], eax
|
||||
; mov eax, [.timer]
|
||||
; mov [es:8*4], eax
|
||||
sti
|
||||
; wait for keypressed
|
||||
xor ax,ax
|
||||
xor ax, ax
|
||||
int 16h
|
||||
push ax
|
||||
; restore timer interrupt
|
||||
@ -532,7 +660,7 @@ cfgmanager:
|
||||
@@:
|
||||
push cx
|
||||
mov cx, 76
|
||||
rep stosw
|
||||
rep stosw
|
||||
pop cx
|
||||
add di, 4*2
|
||||
loop @b
|
||||
@ -546,46 +674,54 @@ cfgmanager:
|
||||
jz .change_a
|
||||
cmp al, 'b'
|
||||
jz .change_b
|
||||
cmp al, 'c'
|
||||
jz .change_c
|
||||
cmp al, 'd'
|
||||
; cmp al, 'c'
|
||||
; jz .change_c
|
||||
cmp al, 'c' ; 'd'
|
||||
jnz .show_remarks
|
||||
_setcursor 15,0
|
||||
mov si, bdev
|
||||
call print
|
||||
if defined extended_primary_loader
|
||||
mov bx, '12'
|
||||
else
|
||||
mov bx, '14'
|
||||
end if
|
||||
call getkey
|
||||
mov [preboot_device], al
|
||||
_setcursor 13,0
|
||||
.d:
|
||||
if ~ defined extended_primary_loader
|
||||
mov [.bSettingsChanged], 1
|
||||
end if
|
||||
call clear_vmodes_table ;clear vmodes_table
|
||||
jmp .printcfg
|
||||
jmp .printcfg
|
||||
.change_a:
|
||||
.loops:
|
||||
call draw_vmodes_table
|
||||
_setcursor 25,0 ; out of screen
|
||||
xor ax,ax
|
||||
xor ax, ax
|
||||
int 0x16
|
||||
; call clear_table_cursor ;clear current position of cursor
|
||||
|
||||
mov si,word [cursor_pos]
|
||||
mov si, word [cursor_pos]
|
||||
|
||||
cmp ah,0x48;x,0x48E0 ; up
|
||||
cmp ah, 0x48;x,0x48E0 ; up
|
||||
jne .down
|
||||
cmp si,modes_table
|
||||
cmp si, modes_table
|
||||
jbe .loops
|
||||
sub word [cursor_pos],size_of_step
|
||||
sub word [cursor_pos], size_of_step
|
||||
jmp .loops
|
||||
|
||||
.down: cmp ah,0x50;x,0x50E0 ; down
|
||||
.down:
|
||||
cmp ah, 0x50;x,0x50E0 ; down
|
||||
jne .pgup
|
||||
cmp word[es:si+10],-1
|
||||
je .loops
|
||||
add word [cursor_pos],size_of_step
|
||||
cmp word[es:si+10], -1
|
||||
je .loops
|
||||
add word [cursor_pos], size_of_step
|
||||
jmp .loops
|
||||
|
||||
.pgup: cmp ah,0x49 ; page up
|
||||
.pgup:
|
||||
cmp ah, 0x49 ; page up
|
||||
jne .pgdn
|
||||
sub si, size_of_step*long_v_table
|
||||
cmp si, modes_table
|
||||
@ -602,7 +738,8 @@ cfgmanager:
|
||||
mov word [home_cursor], si
|
||||
jmp .loops
|
||||
|
||||
.pgdn: cmp ah,0x51 ; page down
|
||||
.pgdn:
|
||||
cmp ah, 0x51 ; page down
|
||||
jne .enter
|
||||
mov ax, [end_cursor]
|
||||
add si, size_of_step*long_v_table
|
||||
@ -622,7 +759,8 @@ cfgmanager:
|
||||
mov word [home_cursor], si
|
||||
jmp .loops
|
||||
|
||||
.enter: cmp al,0x0D;x,0x1C0D ; enter
|
||||
.enter:
|
||||
cmp al, 0x0D;x,0x1C0D ; enter
|
||||
jne .loops
|
||||
push word [cursor_pos]
|
||||
pop bp
|
||||
@ -632,9 +770,9 @@ cfgmanager:
|
||||
pop word [y_save]
|
||||
push word [es:bp+6]
|
||||
pop word [number_vm]
|
||||
mov word [preboot_graph],bp ;save choose
|
||||
mov word [preboot_graph], bp ;save choose
|
||||
|
||||
jmp .d
|
||||
jmp .d
|
||||
|
||||
.change_b:
|
||||
_setcursor 15,0
|
||||
@ -650,15 +788,15 @@ cfgmanager:
|
||||
mov [preboot_biosdisk], al
|
||||
_setcursor 11,0
|
||||
jmp .d
|
||||
.change_c:
|
||||
_setcursor 15,0
|
||||
mov si, vrrmprint
|
||||
call print
|
||||
mov bx, '12'
|
||||
call getkey
|
||||
mov [preboot_vrrm], al
|
||||
_setcursor 12,0
|
||||
jmp .d
|
||||
;.change_c:
|
||||
; _setcursor 15,0
|
||||
; mov si, vrrmprint
|
||||
; call print
|
||||
; mov bx, '12'
|
||||
; call getkey
|
||||
; mov [preboot_vrrm], al
|
||||
; _setcursor 12,0
|
||||
; jmp .d
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
.say_on_off:
|
||||
pushf
|
||||
@ -667,15 +805,20 @@ cfgmanager:
|
||||
popf
|
||||
jz @f
|
||||
mov si, off_msg
|
||||
@@: jmp printplain
|
||||
@@:
|
||||
jmp printplain
|
||||
; novesa and vervesa strings are not used at the moment of executing this code
|
||||
virtual at novesa
|
||||
.oldtimer dd ?
|
||||
.starttime dd ?
|
||||
if ~ defined extended_primary_loader
|
||||
.bSettingsChanged db ?
|
||||
end if
|
||||
.timer dd ?
|
||||
end virtual
|
||||
if ~ defined extended_primary_loader
|
||||
.loader_block dd -1
|
||||
end if
|
||||
.gettime:
|
||||
mov ah, 0
|
||||
int 1Ah
|
||||
@ -692,7 +835,11 @@ end virtual
|
||||
pushad
|
||||
call .gettime
|
||||
sub eax, [.starttime]
|
||||
if defined extended_primary_loader
|
||||
sub ax, [preboot_timeout]
|
||||
else
|
||||
sub ax, 18*5
|
||||
end if
|
||||
jae .timergo
|
||||
neg ax
|
||||
add ax, 18-1
|
||||
@ -708,20 +855,30 @@ if lang eq ru
|
||||
mov cl, 'ã'
|
||||
jz @f
|
||||
mov cl, 'ë'
|
||||
@@: mov [time_str+9], cl
|
||||
@@:
|
||||
mov [time_str+9], cl
|
||||
else if lang eq et
|
||||
cmp al, 1
|
||||
ja @f
|
||||
mov [time_str+9], ' '
|
||||
mov [time_str+10],' '
|
||||
mov [time_str+10], ' '
|
||||
@@:
|
||||
else if lang eq sp
|
||||
; esperar 5/4/3/2 segundos, 1 segundo
|
||||
cmp al, 1
|
||||
mov cl, 's'
|
||||
ja @f
|
||||
mov cl, ' '
|
||||
@@:
|
||||
mov [time_str+10], cl
|
||||
else
|
||||
; wait 5/4/3/2 seconds, 1 second
|
||||
cmp al, 1
|
||||
mov cl, 's'
|
||||
ja @f
|
||||
mov cl, ' '
|
||||
@@: mov [time_str+9], cl
|
||||
@@:
|
||||
mov [time_str+9], cl
|
||||
end if
|
||||
add al, '0'
|
||||
mov [time_str+1], al
|
||||
@ -748,6 +905,7 @@ end if
|
||||
mov si, loading_msg
|
||||
call print
|
||||
_setcursor 15,0
|
||||
if ~ defined extended_primary_loader
|
||||
cmp [.bSettingsChanged], 0
|
||||
jz .load
|
||||
cmp [.loader_block], -1
|
||||
@ -788,6 +946,7 @@ end if
|
||||
call printplain
|
||||
_setcursor 15,0
|
||||
.load:
|
||||
end if
|
||||
; \end{diamond}[02.12.2005]
|
||||
|
||||
; ASK GRAPHICS MODE
|
||||
@ -796,18 +955,17 @@ end if
|
||||
|
||||
; GRAPHICS ACCELERATION
|
||||
; force yes
|
||||
mov [es:0x901C], byte 1
|
||||
mov [es:BOOT_MTRR], byte 1
|
||||
|
||||
; DMA ACCESS TO HD
|
||||
|
||||
mov al, [preboot_dma]
|
||||
mov [es:0x901F], al
|
||||
mov [es:BOOT_DMA], al
|
||||
|
||||
; VRR_M USE
|
||||
|
||||
mov al,[preboot_vrrm]
|
||||
mov [es:0x9030], al
|
||||
mov [es:0x901E], byte 1
|
||||
;; VRR_M USE
|
||||
;
|
||||
; mov al,[preboot_vrrm]
|
||||
; mov [es:0x9030], al
|
||||
|
||||
; BOOT DEVICE
|
||||
|
||||
@ -820,9 +978,9 @@ include '../detect/biosmem.inc'
|
||||
|
||||
; READ DISKETTE TO MEMORY
|
||||
|
||||
cmp [boot_dev],0
|
||||
cmp [boot_dev], 0
|
||||
jne no_sys_on_floppy
|
||||
mov si,diskload
|
||||
mov si, diskload
|
||||
call print
|
||||
xor ax, ax ; reset drive
|
||||
xor dx, dx
|
||||
@ -967,6 +1125,7 @@ sayerr_floppy:
|
||||
mov dx, 0x3f2
|
||||
mov al, 0
|
||||
out dx, al
|
||||
sayerr_memmove:
|
||||
mov si, memmovefailed
|
||||
jmp sayerr_plain
|
||||
@@:
|
||||
@ -1145,6 +1304,40 @@ no_sys_on_floppy:
|
||||
mov al, 0
|
||||
out dx, al
|
||||
|
||||
if defined extended_primary_loader
|
||||
cmp [boot_dev], 1
|
||||
jne no_sys_from_primary
|
||||
; load kolibri.img using callback from primary loader
|
||||
and word [movedesc + 24 + 2], 0
|
||||
mov byte [movedesc + 24 + 4], 10h
|
||||
; read in blocks of 64K until file is fully loaded
|
||||
mov ax, 1
|
||||
.repeat:
|
||||
mov di, image_file_struct
|
||||
call [bootcallback]
|
||||
push cs
|
||||
pop ds
|
||||
push cs
|
||||
pop es
|
||||
cmp bx, 1
|
||||
ja sayerr_badsect
|
||||
push bx
|
||||
mov si, movedesc
|
||||
and word [si + 16 + 2], 0
|
||||
mov byte [si + 16 + 4], 4
|
||||
mov ah, 87h
|
||||
mov cx, 8000h
|
||||
int 15h
|
||||
pop bx
|
||||
test ah, ah
|
||||
jnz sayerr_memmove
|
||||
inc byte [si + 24 + 4]
|
||||
test bx, bx
|
||||
jz no_sys_from_primary
|
||||
mov ax, 2
|
||||
jmp .repeat
|
||||
no_sys_from_primary:
|
||||
end if
|
||||
|
||||
; SET GRAPHICS
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
;
|
||||
;======================================================================
|
||||
|
||||
$Revision $
|
||||
$Revision: 2455 $
|
||||
|
||||
|
||||
d80x25_bottom:
|
||||
@ -23,39 +23,27 @@ d80x25_bottom:
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
msg_apm db " APM x.x ", 0
|
||||
vervesa db "Version of Vesa: Vesa x.x",13,10,0
|
||||
novesa db "Display: EGA/CGA",13,10,0
|
||||
s_vesa db "Version of VESA: "
|
||||
.ver db "?.?",13,10,0
|
||||
|
||||
gr_mode db "Select a videomode: ",13,10,0
|
||||
;s_bpp db 13,10,186," ƒ«ã¡¨ 梥â : "
|
||||
; .bpp dw "??"
|
||||
; db 13,10,0
|
||||
|
||||
vrrmprint db "Apply VRR? (picture frequency greater than 60Hz"
|
||||
db " only for transfers:",13,10
|
||||
db 186," 1024*768->800*600 and 800*600->640*480) [1-yes,2-no]:",0
|
||||
|
||||
|
||||
ask_bd db "Add disks visible by BIOS emulated in V86-mode? [1-yes, 2-no]: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
bdev db "Load ramdisk from [1-floppy; 2-kolibri.img]: ",0
|
||||
else
|
||||
bdev db "Load ramdisk from [1-floppy; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-use preloaded ram-image from kernel restart;"
|
||||
db 13,10,186," "
|
||||
db "4-create blank image]: ",0
|
||||
probetext db 13,10,13,10,186," Use standart graphics mode? [1-yes, "
|
||||
db "2-probe bios (Vesa 3.0)]: ",0
|
||||
;memokz256 db 13,10,186," RAM 256 Mb",0
|
||||
;memokz128 db 13,10,186," RAM 128 Mb",0
|
||||
;memokz64 db 13,10,186," RAM 64 Mb",0
|
||||
;memokz32 db 13,10,186," RAM 32 Mb",0
|
||||
;memokz16 db 13,10,186," RAM 16 Mb",0
|
||||
end if
|
||||
|
||||
prnotfnd db "Fatal - Videomode not found.",0
|
||||
;modena db "Fatal - VBE 0x112+ required.",0
|
||||
|
||||
not386 db "Fatal - CPU 386+ required.",0
|
||||
btns db "Fatal - Can't determine color depth.",0
|
||||
fatalsel db "Fatal - Graphics mode not supported by hardware.",0
|
||||
pres_key db "Press any key to choose a new videomode.",0
|
||||
badsect db 13,10,186," Fatal - Bad sector. Replace floppy.",0
|
||||
@ -73,29 +61,33 @@ time_str db " 5 seconds"
|
||||
current_cfg_msg db "Current settings:",13,10,0
|
||||
curvideo_msg db " [a] Videomode: ",0
|
||||
|
||||
;modes_msg dw mode4,mode1,mode2,mode3
|
||||
;modevesa20 db " with LFB",0
|
||||
;modevesa12 db ", VESA 1.2 Bnk",0
|
||||
mode0 db "320x200, EGA/CGA 256 colors",13,10,0
|
||||
mode9 db "640x480, VGA 16 colors",13,10,0
|
||||
|
||||
;probeno_msg db " (standard mode)",0
|
||||
;probeok_msg db " (check nonstandard modes)",0
|
||||
;dma_msg db " [b] Use DMA for HDD access:",0
|
||||
usebd_msg db " [b] Add disks visible by BIOS:",0
|
||||
on_msg db " on",13,10,0
|
||||
off_msg db " off",13,10,0
|
||||
;readonly_msg db " only for reading",13,10,0
|
||||
vrrm_msg db " [c] Use VRR:",0
|
||||
preboot_device_msg db " [d] Floppy image: ",0
|
||||
|
||||
preboot_device_msg db " [c] Floppy image: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "real floppy",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3
|
||||
pdm1 db "real floppy",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "use already loaded image",13,10,0
|
||||
pdm4 db "create blank image",13,10,0
|
||||
end if
|
||||
|
||||
loading_msg db "Loading KolibriOS...",0
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
save_quest db "Remember current settings? [y/n]: ",0
|
||||
loader_block_error db "Bootloader data invalid, I cannot continue. Stopped.",0
|
||||
end if
|
||||
|
||||
_st db 186,' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ¿',13,10,0
|
||||
_r1 db 186,' ³ 320x200 EGA/CGA 256 colors ³ ³',13,10,0
|
||||
@ -104,7 +96,6 @@ _rs db 186,'
|
||||
_bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÙ',13,10,0
|
||||
|
||||
remark1 db "Default values were selected to match most of configurations, but not all.",0
|
||||
remark2 db "If you have CRT-monitor, enable VRR in the item [c].",0
|
||||
remark3 db "If the system does not boot, try to disable the item [b].",0
|
||||
remarks dw remark1, remark2, remark3
|
||||
num_remarks = 3
|
||||
remark2 db "If the system does not boot, try to disable the item [b].",0
|
||||
remarks dw remark1, remark2
|
||||
num_remarks = 2
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;======================================================================
|
||||
;
|
||||
@ -13,60 +13,39 @@
|
||||
|
||||
$Revision$
|
||||
|
||||
|
||||
|
||||
d80x25_bottom:
|
||||
db 186,' KolibriOS based on MenuetOS and comes with ABSOLUTELY '
|
||||
db 'NO WARRANTY ',186
|
||||
db 186,' See file COPYING for details '
|
||||
db 186,' KolibriOS pohineb MenuetOS ja kaasas IGASUGUSE GARANTI'
|
||||
db 'ITA ',186
|
||||
db 186,' Naha faili COPYING detailid '
|
||||
db ' ',186
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
msg_apm db " APM x.x ", 0
|
||||
novesa db "Ekraan: EGA/CGA",13,10,0
|
||||
vervesa db "Vesa versioon: Vesa x.x",13,10,0
|
||||
vervesa_off=20
|
||||
msg_apm db " APM x.x ", 0
|
||||
gr_mode db 186," Vesa 2.0+ 16 M LFB: [1] 640x480, [2] 800x600, "
|
||||
db "[3] 1024x768, [4] 1280x1024",13,10
|
||||
db 186," Vesa 1.2 16 M Bnk: [5] 640x480, [6] 800x600, "
|
||||
db "[7] 1024x768, [8] 1280x1024",13,10
|
||||
db 186," EGA/CGA 256 värvi: [9] 320x200, "
|
||||
db "VGA 16 värvi: [0] 640x480",13,10
|
||||
db 186," Vali reziim: ",0
|
||||
bt24 db "Bitti pikseli kohta: 24",13,10,0
|
||||
bt32 db "Bitti pikseli kohta: 32",13,10,0
|
||||
vrrmprint db "Kinnita VRR? (ekraani sagedus suurem kui 60Hz"
|
||||
db " ainult:",13,10
|
||||
db 186," 1024*768->800*600 ja 800*600->640*480) [1-jah,2-ei]:",0
|
||||
;askmouse db " Hiir:"
|
||||
; db " [1] PS/2 (USB), [2] Com1, [3] Com2."
|
||||
; db " Vali port [1-3]: ",0
|
||||
;no_com1 db 13,10,186, " No COM1 mouse",0
|
||||
;no_com2 db 13,10,186, " No COM2 mouse",0
|
||||
;ask_dma db "Use DMA for HDD access? [1-yes, 2-only for reading, 3-no]: ",0
|
||||
ask_bd db "Add disks visible by BIOS emulated in V86-mode? [1-yes, 2-no]: ",0
|
||||
;gr_direct db 186," Use direct LFB writing? "
|
||||
; db "[1-yes/2-no] ? ",0
|
||||
;mem_model db 13,10,186," Motherboard memory [1-16 Mb / 2-32 Mb / "
|
||||
; db "3-64Mb / 4-128 Mb / 5-256 Mb] ? ",0
|
||||
;bootlog db 13,10,186," After bootlog display [1-continue/2-pause] ? ",0
|
||||
s_vesa db "Vesa versioon: "
|
||||
.ver db "?.?",13,10,0
|
||||
|
||||
gr_mode db "Vali videomode: ",13,10,0
|
||||
|
||||
ask_bd db "Lisa kettad nahtavaks BIOS reziim V86? [1-jah, 2-no]: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
bdev db "Paigalda mäluketas [1-diskett; 2-kolibri.img]: ",0
|
||||
else
|
||||
bdev db "Paigalda mäluketas [1-diskett; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-kasuta eellaaditud mäluketast kerneli restardist;"
|
||||
db 13,10,186," "
|
||||
db "4-loo tühi pilt]: ",0
|
||||
probetext db 13,10,13,10,186," Kasuta standartset graafika reziimi? [1-jah, "
|
||||
db "2-leia biosist (Vesa 3.0)]: ",0
|
||||
;memokz256 db 13,10,186," RAM 256 Mb",0
|
||||
;memokz128 db 13,10,186," RAM 128 Mb",0
|
||||
;memokz64 db 13,10,186," RAM 64 Mb",0
|
||||
;memokz32 db 13,10,186," RAM 32 Mb",0
|
||||
;memokz16 db 13,10,186," RAM 16 Mb",0
|
||||
end if
|
||||
|
||||
prnotfnd db "Fataalne - Videoreziimi ei leitud.",0
|
||||
;modena db "Fataalne - VBE 0x112+ on vajalik.",0
|
||||
|
||||
not386 db "Fataalne - CPU 386+ on vajalik.",0
|
||||
btns db "Fataalne - Ei suuda värvisügavust määratleda.",0
|
||||
fatalsel db "Fataalne - Graafilist reziimi riistvara ei toeta.",0
|
||||
pres_key db "Vajutage suvalist klahvi, et valida uus videomode.",0
|
||||
badsect db 13,10,186," Fataalne - Vigane sektor. Asenda diskett.",0
|
||||
memmovefailed db 13,10,186," Fataalne - Int 0x15 liigutamine ebaõnnestus.",0
|
||||
okt db " ... OK"
|
||||
@ -81,35 +60,42 @@ time_str db " 5 sekundit"
|
||||
db " automaatseks jätkamiseks",13,10,0
|
||||
current_cfg_msg db "Praegused seaded:",13,10,0
|
||||
curvideo_msg db " [a] Videoreziim: ",0
|
||||
mode1 db "640x480",0
|
||||
mode2 db "800x600",0
|
||||
mode3 db "1024x768",0
|
||||
mode4 db "1280x1024",0
|
||||
modes_msg dw mode4,mode1,mode2,mode3
|
||||
modevesa20 db " koos LFB",0
|
||||
modevesa12 db ", VESA 1.2 Bnk",0
|
||||
mode9 db "320x200, EGA/CGA 256 värvi",0
|
||||
mode10 db "640x480, VGA 16 värvi",0
|
||||
probeno_msg db " (standard reziim)",0
|
||||
probeok_msg db " (kontrolli ebastandardseid reziime)",0
|
||||
;dma_msg db " [b] Kasuta DMA'd HDD juurdepääsuks:",0
|
||||
usebd_msg db " [b] Add disks visible by BIOS:",0
|
||||
|
||||
mode0 db "320x200, EGA/CGA 256 värvi",0
|
||||
mode9 db "640x480, VGA 16 värvi",0
|
||||
|
||||
usebd_msg db " [b] Lisa kettad nahtavaks BIOS:",0
|
||||
on_msg db " sees",13,10,0
|
||||
off_msg db " väljas",13,10,0
|
||||
;readonly_msg db " ainult lugemiseks",13,10,0
|
||||
vrrm_msg db " [c] Kasuta VRR:",0
|
||||
preboot_device_msg db " [d] Disketi kujutis: ",0
|
||||
|
||||
preboot_device_msg db " [c] Disketi kujutis: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "reaalne diskett",13,10,0
|
||||
pdm2 db "kolibri.img",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3
|
||||
pdm1 db "reaalne diskett",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "kasuta juba laaditud kujutist",13,10,0
|
||||
pdm4 db "loo tühi pilt",13,10,0
|
||||
end if
|
||||
|
||||
loading_msg db "Laadin KolibriOS...",0
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
save_quest db "Jäta meelde praegused seaded? [y/n]: ",0
|
||||
loader_block_error db "Alglaaduri andmed vigased, ei saa jätkata. Peatatud.",0
|
||||
end if
|
||||
|
||||
remark1 db "Default values were selected to match most of configurations, but not all.",0
|
||||
remark2 db "If you have CRT-monitor, enable VRR in the item [c].",0
|
||||
remark3 db "If the system does not boot, try to disable the item [b].",0
|
||||
remarks dw remark1, remark2, remark3
|
||||
num_remarks = 3
|
||||
_st db 186,' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ¿',13,10,0
|
||||
_r1 db 186,' ³ 320x200 EGA/CGA 256 colors ³ ³',13,10,0
|
||||
_r2 db 186,' ³ 640x480 VGA 16 colors ³ ³',13,10,0
|
||||
_rs db 186,' ³ ????x????@?? SVGA VESA ³ ³',13,10,0
|
||||
_bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÙ',13,10,0
|
||||
|
||||
remark1 db "Vaikimisi maaratud vaartused on valitud mugavuse enamikes, kuid mitte koik.",0
|
||||
remark2 db "Kui susteem ei kaivitu, proovige lulitada kirje [b].",0
|
||||
remarks dw remark1, remark2
|
||||
num_remarks = 2
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;======================================================================
|
||||
;
|
||||
@ -15,11 +15,6 @@ $Revision$
|
||||
|
||||
|
||||
d80x25_bottom:
|
||||
; db 186,' KolibriOS based on MenuetOS and comes with ABSOLUTELY '
|
||||
; db 'NO WARRANTY ',186
|
||||
; db 186,' See file COPYING for details '
|
||||
; db ' ',186
|
||||
|
||||
db 186,' KolibriOS basiert auf MenuetOS und wird ohne jegliche '
|
||||
db ' Garantie vertrieben ',186
|
||||
db 186,' Details stehen in der Datei COPYING '
|
||||
@ -27,51 +22,30 @@ d80x25_bottom:
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
msg_apm db " APM x.x ", 0
|
||||
novesa db "Anzeige: EGA/CGA ",13,10,0
|
||||
vervesa db "Vesa-Version: Vesa ",13,10,0
|
||||
vervesa_off=22
|
||||
msg_apm db " APM x.x ", 0
|
||||
gr_mode db 186," Vesa 2.0+ 16 M LFB: [1] 640x480, [2] 800x600, "
|
||||
db "[3] 1024x768, [4] 1280x1024",13,10
|
||||
db 186," Vesa 1.2 16 M Bnk: [5] 640x480, [6] 800x600, "
|
||||
db "[7] 1024x768, [8] 1280x1024",13,10
|
||||
db 186," EGA/CGA 256 Farben: [9] 320x200, "
|
||||
db "VGA 16 Farben: [0] 640x480",13,10
|
||||
db 186," Waehle Modus: ",0
|
||||
bt24 db "Bits Per Pixel: 24",13,10,0
|
||||
bt32 db "Bits Per Pixel: 32",13,10,0
|
||||
vrrmprint db "VRR verwenden? (Monitorfrequenz groesser als 60Hz"
|
||||
db " only for transfers:",13,10
|
||||
db 186," 1024*768->800*600 und 800*600->640*480) [1-ja,2-nein]:",0
|
||||
;askmouse db " Maus angeschlossen an:"
|
||||
; db " [1] PS/2 (USB), [2] Com1, [3] Com2."
|
||||
; db " Waehle Port [1-3]: ",0
|
||||
;no_com1 db 13,10,186, " Keine COM1 Maus",0
|
||||
;no_com2 db 13,10,186, " Keine COM2 Maus",0
|
||||
;ask_dma db "Nutze DMA zum HDD Zugriff? [1-ja, 2-allein fur Lesen, 3-nein]: ",0
|
||||
ask_bd db "Add disks visible by BIOS emulated in V86-mode? [1-yes, 2-no]: ",0
|
||||
;gr_direct db 186," Benutze direct LFB? "
|
||||
; db "[1-ja/2-nein] ? ",0
|
||||
;mem_model db 13,10,186," Hauptspeicher [1-16 Mb / 2-32 Mb / "
|
||||
; db "3-64Mb / 4-128 Mb / 5-256 Mb] ? ",0
|
||||
;bootlog db 13,10,186," After bootlog display [1-continue/2-pause] ? ",0
|
||||
s_vesa db "Vesa-Version: "
|
||||
.ver db "?.?",13,10,0
|
||||
|
||||
gr_mode db "Wahlen Sie einen videomode: ",13,10,0
|
||||
|
||||
ask_bd db "Add-Festplatten sichtbar BIOS in V86-Modus emuliert? [1-ja, 2 nein]: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
bdev db "Lade die Ramdisk von [1-Diskette; 2-kolibri.img]: ",0
|
||||
else
|
||||
bdev db "Lade die Ramdisk von [1-Diskette; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-benutze ein bereits geladenes Kernel image;"
|
||||
db 13,10,186," "
|
||||
db "4-create blank image]: ",0
|
||||
probetext db 13,10,13,10,186," Nutze Standardgrafikmodi? [1-ja, "
|
||||
db "2-BIOS Test (Vesa 3.0)]: ",0
|
||||
;memokz256 db 13,10,186," RAM 256 Mb",0
|
||||
;memokz128 db 13,10,186," RAM 128 Mb",0
|
||||
;memokz64 db 13,10,186," RAM 64 Mb",0
|
||||
;memokz32 db 13,10,186," RAM 32 Mb",0
|
||||
;memokz16 db 13,10,186," RAM 16 Mb",0
|
||||
end if
|
||||
|
||||
prnotfnd db "Fatal - Videomodus nicht gefunden.",0
|
||||
;modena db "Fatal - VBE 0x112+ required.",0
|
||||
|
||||
not386 db "Fatal - CPU 386+ benoetigt.",0
|
||||
btns db "Fatal - konnte Farbtiefe nicht erkennen.",0
|
||||
fatalsel db "Fatal - Grafikmodus nicht unterstuetzt.",0
|
||||
pres_key db "Drucken Sie eine beliebige Taste, um eine neue videomode wahlen.",0
|
||||
badsect db 13,10,186," Fatal - Sektorfehler, Andere Diskette neutzen.",0
|
||||
memmovefailed db 13,10,186," Fatal - Int 0x15 Fehler.",0
|
||||
okt db " ... OK"
|
||||
@ -80,41 +54,48 @@ diskload db "Lade Diskette: 00 %",8,8,8,8,0
|
||||
pros db "00"
|
||||
backspace2 db 8,8,0
|
||||
boot_dev db 0 ; 0=floppy, 1=hd
|
||||
start_msg db "Druecke [abcd], um die Einstellungen zu aendern , druecke [Enter] zum starten",13,10,0
|
||||
start_msg db "Druecke [abcd], um die Einstellungen zu aendern, druecke [Enter] zum starten",13,10,0
|
||||
time_msg db " oder warte "
|
||||
time_str db " 5 Sekunden"
|
||||
db " bis zum automatischen Start",13,10,0
|
||||
current_cfg_msg db "Aktuelle Einstellungen:",13,10,0
|
||||
curvideo_msg db " [a] Videomodus: ",0
|
||||
mode1 db "640x480",0
|
||||
mode2 db "800x600",0
|
||||
mode3 db "1024x768",0
|
||||
mode4 db "1280x1024",0
|
||||
modes_msg dw mode4,mode1,mode2,mode3
|
||||
modevesa20 db " mit LFB",0
|
||||
modevesa12 db ", VESA 1.2 Bnk",0
|
||||
mode9 db "320x200, EGA/CGA 256 colors",0
|
||||
mode10 db "640x480, VGA 16 colors",0
|
||||
probeno_msg db " (Standard Modus)",0
|
||||
probeok_msg db " (teste nicht-standard Modi)",0
|
||||
;dma_msg db " [b] Nutze DMA zum HDD Aufschreiben:",0
|
||||
usebd_msg db " [b] Add disks visible by BIOS:",0
|
||||
|
||||
mode0 db "320x200, EGA/CGA 256 colors",13,10,0
|
||||
mode9 db "640x480, VGA 16 colors",13,10,0
|
||||
|
||||
usebd_msg db " [b] Add-Festplatten sichtbar durch das BIOS:",0
|
||||
on_msg db " an",13,10,0
|
||||
off_msg db " aus",13,10,0
|
||||
;readonly_msg db " fur Lesen",13,10,0
|
||||
vrrm_msg db " [c] Nutze VRR:",0
|
||||
preboot_device_msg db " [d] Diskettenimage: ",0
|
||||
|
||||
preboot_device_msg db " [c] Diskettenimage: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "Echte Diskette",13,10,0
|
||||
pdm2 db "kolibri.img",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3
|
||||
pdm1 db "Echte Diskette",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "Nutze bereits geladenes Image",13,10,0
|
||||
pdm4 db "create blank image",13,10,0
|
||||
end if
|
||||
|
||||
loading_msg db "Lade KolibriOS...",0
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
save_quest db "Aktuelle Einstellungen speichern? [y/n]: ",0
|
||||
loader_block_error db "Bootloader Daten ungueltig, Kann nicht fortfahren. Angehalten.",0
|
||||
end if
|
||||
|
||||
remark1 db "Default values were selected to match most of configurations, but not all.",0
|
||||
remark2 db "If you have CRT-monitor, enable VRR in the item [c].",0
|
||||
remark3 db "If the system does not boot, try to disable the item [b].",0
|
||||
remarks dw remark1, remark2, remark3
|
||||
num_remarks = 3
|
||||
_st db 186,' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ¿',13,10,0
|
||||
_r1 db 186,' ³ 320x200 EGA/CGA 256 colors ³ ³',13,10,0
|
||||
_r2 db 186,' ³ 640x480 VGA 16 colors ³ ³',13,10,0
|
||||
_rs db 186,' ³ ????x????@?? SVGA VESA ³ ³',13,10,0
|
||||
_bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÙ',13,10,0
|
||||
|
||||
remark1 db "Die Standardwerte sind fur die meisten gewahlt, aber nicht fur jedermann.",0
|
||||
remark2 db "Wenn das System nicht bootet, versuchen, das Element [b] deaktivieren.",0
|
||||
remarks dw remark1, remark2
|
||||
num_remarks = 2
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;=================================================================
|
||||
;
|
||||
@ -15,8 +15,8 @@ $Revision$
|
||||
|
||||
|
||||
d80x25_bottom:
|
||||
db 186,' Kolibri OS ®á®¢ Menuet OS ¨ ¥ ¯à¥¤®áâ ¢«ï¥â '
|
||||
db '¨ª ª¨å £ àa⨩. ',186
|
||||
db 186,' KolibriOS ®á®¢ MenuetOS ¨ <20>… <20><>…„Ž‘’€‚‹Ÿ…’ <20>ˆ'
|
||||
db 'Š€Šˆ• ƒ€<C692>A<EFBFBD>’ˆ‰. ',186
|
||||
db 186,' <20>®¤à®¡¥¥ ᬮâà¨â¥ ¢ ä ©«¥ COPYING.TXT '
|
||||
db ' ',186
|
||||
line_full_bottom
|
||||
@ -28,17 +28,21 @@ s_vesa db "
|
||||
.ver db "?.?",13,10,0
|
||||
|
||||
gr_mode db "‚ë¡¥à¨â¥ ¢¨¤¥®à¥¦¨¬: ",13,10,0
|
||||
vrrmprint db "ˆá¯®«ì§®¢ âì VRR? (ç áâ®â ª ¤à®¢ ¢ëè¥ 60 ƒæ"
|
||||
db " ⮫쪮 ¤«ï ¯¥à¥å®¤®¢:",13,10
|
||||
db 186," 1024*768>800*600 ¨ 800*600>640*480) [1-¤ , 2-¥â]: ",0
|
||||
;ask_dma db "ˆá¯®«ì§®¢ âì DMA ¤«ï ¤®áâ㯠ª HDD? [1-¤ , 2-⮫쪮 ç⥨¥, 3-¥â]: ",0
|
||||
|
||||
ask_bd db "„®¡ ¢¨âì ¤¨áª¨, ¢¨¤¨¬ë¥ ç¥à¥§ BIOS ¢ ०¨¬¥ V86? [1-¤ , 2-¥â]: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
bdev db "‡ £à㧨âì ®¡à § ¨§ [1-¤¨áª¥â ; 2-kolibri.img ¨§ ¯ ¯ª¨ § £à㧪¨]: ",0
|
||||
else
|
||||
bdev db "‡ £à㧨âì ®¡à § ¨§ [1-¤¨áª¥â ; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-¨á¯®«ì§®¢ âì 㦥 § £àã¦¥ë© ®¡à §;"
|
||||
db 13,10,186," "
|
||||
db "4-ᮧ¤ âì ç¨áâë© ®¡à §]: ",0
|
||||
end if
|
||||
|
||||
prnotfnd db "Žè¨¡ª - ‚¨¤¥®à¥¦¨¬ ¥ ©¤¥.",0
|
||||
|
||||
not386 db "Žè¨¡ª - ’ॡã¥âáï ¯à®æ¥áá®à 386+.",0
|
||||
fatalsel db "Žè¨¡ª - ‚ë¡à ë© ¢¨¤¥®à¥¦¨¬ ¥ ¯®¤¤¥à¦¨¢ ¥âáï.",0
|
||||
pres_key db "<EFBFBD> ¦¨¬¨â¥ «î¡ãî ª« ¢¨èã, ¤«ï ¯¥à¥å®¤ ¢ ¢ë¡®à ०¨¬®¢.",0
|
||||
@ -57,25 +61,33 @@ time_str db " 5 ᥪ㭤 "
|
||||
current_cfg_msg db "’¥ªã騥 áâனª¨:",13,10,0
|
||||
curvideo_msg db " [a] ‚¨¤¥®à¥¦¨¬: ",0
|
||||
|
||||
|
||||
mode0 db "320x200, EGA/CGA 256 梥⮢",13,10,0
|
||||
mode9 db "640x480, VGA 16 梥⮢",13,10,0
|
||||
|
||||
usebd_msg db " [b] „®¡ ¢¨âì ¤¨áª¨, ¢¨¤¨¬ë¥ ç¥à¥§ BIOS:",0
|
||||
on_msg db " ¢ª«",13,10,0
|
||||
off_msg db " ¢ëª«",13,10,0
|
||||
readonly_msg db " ⮫쪮 ç⥨¥",13,10,0
|
||||
vrrm_msg db " [c] ˆá¯®«ì§®¢ ¨¥ VRR:",0
|
||||
preboot_device_msg db " [d] Ž¡à § ¤¨áª¥âë: ",0
|
||||
|
||||
preboot_device_msg db " [c] Ž¡à § ¤¨áª¥âë: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db " áâ®ïé ï ¤¨áª¥â ",13,10,0
|
||||
pdm2 db "kolibri.img ¨§ ¯ ¯ª¨ § £à㧪¨",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3,pdm4
|
||||
pdm1 db " áâ®ïé ï ¤¨áª¥â ",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "¨á¯®«ì§®¢ âì 㦥 § £àã¦¥ë© ®¡à §",13,10,0
|
||||
pdm4 db "ᮧ¤ âì ç¨áâë© ®¡à §",13,10,0
|
||||
end if
|
||||
|
||||
loading_msg db "ˆ¤ñâ § £à㧪 KolibriOS...",0
|
||||
|
||||
if ~ defined extended_primary_loader ; saving not supported in this case
|
||||
save_quest db "‡ ¯®¬¨âì ⥪ã騥 áâனª¨? [y/n]: ",0
|
||||
loader_block_error db "Žè¨¡ª ¢ ¤ ëå ç «ì®£® § £àã§ç¨ª , ¯à®¤®«¦¥¨¥ ¥¢®§¬®¦®.",0
|
||||
|
||||
end if
|
||||
|
||||
_st db 186,' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ¿ ',13,10,0
|
||||
_r1 db 186,' ³ 320x200 EGA/CGA 256 梥⮢ ³ ³ ',13,10,0
|
||||
@ -83,9 +95,7 @@ _r2 db 186,'
|
||||
_rs db 186,' ³ ????x????@?? SVGA VESA ³ ³ ',13,10,0
|
||||
_bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÙ ',13,10,0
|
||||
|
||||
|
||||
remark1 db "‡ ç¥¨ï ¯® 㬮«ç ¨î ¢ë¡à ë ¤«ï 㤮¡á⢠¡®«ìè¨á⢠, ® ¥ ¢á¥å.",0
|
||||
remark2 db "…᫨ ã ‚ á <20>‹’-¬®¨â®à, ¢ª«îç¨â¥ VRR ¢ ¯ãªâ¥ [c].",0
|
||||
remark3 db "…᫨ ã ‚ á ¥ £à㧨âáï á¨á⥬ , ¯®¯à®¡ã©â¥ ®âª«îç¨âì ¯ãªâ [b].",0
|
||||
remarks dw remark1, remark2, remark3
|
||||
num_remarks = 3
|
||||
remark2 db "…᫨ ã ‚ á ¥ £à㧨âáï á¨á⥬ , ¯®¯à®¡ã©â¥ ®âª«îç¨âì ¯ãªâ [b].",0
|
||||
remarks dw remark1, remark2
|
||||
num_remarks = 2
|
||||
|
103
kernel/branches/net/boot/bootsp.inc
Normal file
103
kernel/branches/net/boot/bootsp.inc
Normal file
@ -0,0 +1,103 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
;======================================================================
|
||||
;
|
||||
; BOOT DATA
|
||||
;
|
||||
;======================================================================
|
||||
|
||||
; Para modificar ‚ste archivo es necesario abrirlo con codificaci¢n CP850
|
||||
|
||||
$Revision: 2455 $
|
||||
|
||||
|
||||
d80x25_bottom:
|
||||
db 186,' KolibriOS est basado en MenuetOS y viene ABSOLUTAMENTE '
|
||||
db 'SIN GARANT¡A ',186
|
||||
db 186,' Lee el archivo COPYING por m s detalles '
|
||||
db ' ',186
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
msg_apm db " APM x.x ", 0
|
||||
novesa db "Monitor: EGA/CGA",13,10,0
|
||||
s_vesa db "Versi¢n de VESA: "
|
||||
.ver db "?.?",13,10,0
|
||||
|
||||
gr_mode db "Selecciona un modo de video: ",13,10,0
|
||||
|
||||
ask_bd db "¨Agregar discos visibles por el BIOS emulados en modo V86? [1-si, 2-no]: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
bdev db "Cargar unidad ram desde [1-disquete; 2-kolibri.img]: ",0
|
||||
else
|
||||
bdev db "Cargar unidad ram desde [1-disquete; 2-C:\kolibri.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-usar imagen precargada en el reinicio del n£cleo;"
|
||||
db 13,10,186," "
|
||||
db "4-crear imagen vac¡a]: ",0
|
||||
end if
|
||||
|
||||
prnotfnd db "Fatal - Modo de video no encontrado.",0
|
||||
|
||||
not386 db "Fatal - CPU 386+ requerido.",0
|
||||
fatalsel db "Fatal - Modo de gr ficos no soportado por hardware.",0
|
||||
pres_key db "Presiona una tecla para seleccionar otro modo de video.",0
|
||||
badsect db 13,10,186," Fatal - Sector mal. Reemplaze el disquete.",0
|
||||
memmovefailed db 13,10,186," Fatal - Int 0x15 move failed.",0
|
||||
okt db " ... BIEN"
|
||||
linef db 13,10,0
|
||||
diskload db "Cargando disquete: 00 %",8,8,8,8,0
|
||||
pros db "00"
|
||||
backspace2 db 8,8,0
|
||||
boot_dev db 0 ; 0=floppy, 1=hd
|
||||
start_msg db "Presiona [abcd] para cambiar la configuraci¢n, [Enter] para continuar",13,10,0
|
||||
time_msg db " o espera "
|
||||
time_str db " 5 segundos"
|
||||
db " para que inicie autom ticamente",13,10,0
|
||||
current_cfg_msg db "Configuraci¢n actual:",13,10,0
|
||||
curvideo_msg db " [a] Modo de video: ",0
|
||||
|
||||
mode0 db "320x200, EGA/CGA 256 colores",13,10,0
|
||||
mode9 db "640x480, VGA 16 colores",13,10,0
|
||||
|
||||
usebd_msg db " [b] Agregar discos visibles por el BIOS:",0
|
||||
on_msg db " activado",13,10,0
|
||||
off_msg db " desactivado",13,10,0
|
||||
|
||||
preboot_device_msg db " [c] Imagen de disquete: ",0
|
||||
|
||||
if defined extended_primary_loader
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,0
|
||||
pdm1 db "disquete real",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
else
|
||||
preboot_device_msgs dw 0,pdm1,pdm2,pdm3
|
||||
pdm1 db "disquete real",13,10,0
|
||||
pdm2 db "C:\kolibri.img (FAT32)",13,10,0
|
||||
pdm3 db "usar imagen ya cargada",13,10,0
|
||||
pdm4 db "crear imagen vac¡a",13,10,0
|
||||
end if
|
||||
|
||||
loading_msg db "Cargando KolibriOS...",0
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
save_quest db "¨Recordar configuraci¢n actual? [s/n]: ",0
|
||||
loader_block_error db "Bootloader inv lido, no puedo continuar. Detenido.",0
|
||||
end if
|
||||
|
||||
_st db 186,' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ¿',13,10,0
|
||||
_r1 db 186,' ³ 320x200 EGA/CGA 256 colores ³ ³',13,10,0
|
||||
_r2 db 186,' ³ 640x480 VGA 16 colores ³ ³',13,10,0
|
||||
_rs db 186,' ³ ????x????@?? SVGA VESA ³ ³',13,10,0
|
||||
_bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÙ',13,10,0
|
||||
|
||||
remark1 db "Los valores por defecto puede que no funcionen en algunas configuraciones.",0
|
||||
remark2 db "Si el sistema no inicia, prueba deshabilitar la opci¢n [b].",0
|
||||
remarks dw remark1, remark2
|
||||
num_remarks = 2
|
@ -42,7 +42,8 @@ end while
|
||||
store byte ' ' at d80x25_top+cur_line_pos
|
||||
store dword ' SVN' at d80x25_top+cur_line_pos-4
|
||||
|
||||
space_msg: line_space
|
||||
space_msg:
|
||||
line_space
|
||||
verstr:
|
||||
; line_space
|
||||
; version string
|
||||
|
@ -89,26 +89,28 @@ scroll_area_size equ (long_v_table-2)
|
||||
int2str:
|
||||
dec bl
|
||||
jz @f
|
||||
xor edx,edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
push edx
|
||||
call int2str
|
||||
pop eax
|
||||
@@: or al,0x30
|
||||
mov [ds:di],al
|
||||
@@:
|
||||
or al, 0x30
|
||||
mov [ds:di], al
|
||||
inc di
|
||||
ret
|
||||
|
||||
int2strnz:
|
||||
cmp eax,ecx
|
||||
cmp eax, ecx
|
||||
jb @f
|
||||
xor edx,edx
|
||||
xor edx, edx
|
||||
div ecx
|
||||
push edx
|
||||
call int2strnz
|
||||
pop eax
|
||||
@@: or al,0x30
|
||||
mov [es:di],al
|
||||
@@:
|
||||
or al, 0x30
|
||||
mov [es:di], al
|
||||
inc di
|
||||
ret
|
||||
|
||||
@ -119,9 +121,9 @@ v_mode_error:
|
||||
mov si, fatalsel
|
||||
call printplain
|
||||
_setcursor 20,2
|
||||
mov si,pres_key
|
||||
mov si, pres_key
|
||||
call printplain
|
||||
xor eax,eax
|
||||
xor eax, eax
|
||||
int 16h
|
||||
jmp cfgmanager.d
|
||||
;-------------------------------------------------------
|
||||
@ -133,45 +135,45 @@ v_mode_error:
|
||||
print_vesa_info:
|
||||
_setcursor 5,2
|
||||
|
||||
mov [es:vi.VESASignature],'VBE2'
|
||||
mov ax,0x4F00
|
||||
mov di,vi ;0xa000
|
||||
mov [es:vi.VESASignature], 'VBE2'
|
||||
mov ax, 0x4F00
|
||||
mov di, vi ;0xa000
|
||||
int 0x10
|
||||
or ah,ah
|
||||
or ah, ah
|
||||
jz @f
|
||||
mov [es:vi.VESASignature],'VESA'
|
||||
mov ax,$4F00
|
||||
mov di,vi
|
||||
mov [es:vi.VESASignature], 'VESA'
|
||||
mov ax, $4F00
|
||||
mov di, vi
|
||||
int 0x10
|
||||
or ah,ah
|
||||
or ah, ah
|
||||
jnz .exit
|
||||
@@:
|
||||
cmp [es:vi.VESASignature],'VESA'
|
||||
cmp [es:vi.VESASignature], 'VESA'
|
||||
jne .exit
|
||||
cmp [es:vi.VESAVersion],0x0100
|
||||
cmp [es:vi.VESAVersion], 0x0100
|
||||
jb .exit
|
||||
jmp .vesaok2
|
||||
|
||||
.exit:
|
||||
mov si,novesa
|
||||
mov si, novesa
|
||||
call printplain
|
||||
ret
|
||||
|
||||
.vesaok2:
|
||||
mov ax,[es:vi.VESAVersion]
|
||||
add ax,'00'
|
||||
mov ax, [es:vi.VESAVersion]
|
||||
add ax, '00'
|
||||
|
||||
mov [s_vesa.ver], ah
|
||||
mov [s_vesa.ver+2], al
|
||||
mov si,s_vesa
|
||||
mov si, s_vesa
|
||||
call printplain
|
||||
|
||||
_setcursor 4,2
|
||||
mov si,word[es:vi.OemStringPtr]
|
||||
mov di,si
|
||||
mov si, word[es:vi.OemStringPtr]
|
||||
mov di, si
|
||||
|
||||
push ds
|
||||
mov ds,word[es:vi.OemStringPtr+2]
|
||||
mov ds, word[es:vi.OemStringPtr+2]
|
||||
call printplain
|
||||
pop ds
|
||||
|
||||
@ -186,33 +188,33 @@ calc_vmodes_table:
|
||||
|
||||
lfs si, [es:vi.VideoModePtr]
|
||||
|
||||
mov bx,modes_table
|
||||
mov bx, modes_table
|
||||
;save no vesa mode of work 320x200, EGA/CGA 256 梥⮢ and 640x480, VGA 16 梥⮢
|
||||
mov word [es:bx],640
|
||||
mov word [es:bx+2],480
|
||||
mov word [es:bx+6],0x13
|
||||
mov word [es:bx], 640
|
||||
mov word [es:bx+2], 480
|
||||
mov word [es:bx+6], 0x13
|
||||
|
||||
mov word [es:bx+10],640
|
||||
mov word [es:bx+12],480
|
||||
mov word [es:bx+16],0x12
|
||||
add bx,20
|
||||
mov word [es:bx+10], 640
|
||||
mov word [es:bx+12], 480
|
||||
mov word [es:bx+16], 0x12
|
||||
add bx, 20
|
||||
.next_mode:
|
||||
mov cx,word [fs:si] ; mode number
|
||||
cmp cx,-1
|
||||
mov cx, word [fs:si]; mode number
|
||||
cmp cx, -1
|
||||
je .modes_ok.2
|
||||
|
||||
mov ax,0x4F01
|
||||
mov di,mi
|
||||
mov ax, 0x4F01
|
||||
mov di, mi
|
||||
int 0x10
|
||||
|
||||
or ah,ah
|
||||
or ah, ah
|
||||
jnz .modes_ok.2;vesa_info.exit
|
||||
|
||||
test [es:mi.ModeAttributes],00000001b ;videomode support ?
|
||||
test [es:mi.ModeAttributes], 00000001b ;videomode support ?
|
||||
jz @f
|
||||
test [es:mi.ModeAttributes],00010000b ;picture ?
|
||||
test [es:mi.ModeAttributes], 00010000b ;picture ?
|
||||
jz @f
|
||||
test [es:mi.ModeAttributes],10000000b ;LFB ?
|
||||
test [es:mi.ModeAttributes], 10000000b ;LFB ?
|
||||
jz @f
|
||||
|
||||
cmp [es:mi.BitsPerPixel], 24 ;It show only videomodes to have support 24 and 32 bpp
|
||||
@ -226,38 +228,39 @@ calc_vmodes_table:
|
||||
|
||||
|
||||
.l0:
|
||||
cmp [es:mi.XRes],640
|
||||
cmp [es:mi.XRes], 640
|
||||
jb @f
|
||||
cmp [es:mi.YRes],480
|
||||
cmp [es:mi.YRes], 480
|
||||
jb @f
|
||||
; cmp [es:mi.BitsPerPixel],8
|
||||
; jb @f
|
||||
|
||||
mov ax,[es:mi.XRes]
|
||||
mov [es:bx+0],ax ; +0[2] : resolution X
|
||||
mov ax,[es:mi.YRes]
|
||||
mov [es:bx+2],ax ; +2[2] : resolution Y
|
||||
mov ax,[es:mi.ModeAttributes]
|
||||
mov [es:bx+4],ax ; +4[2] : attributes
|
||||
mov ax, [es:mi.XRes]
|
||||
mov [es:bx+0], ax ; +0[2] : resolution X
|
||||
mov ax, [es:mi.YRes]
|
||||
mov [es:bx+2], ax ; +2[2] : resolution Y
|
||||
mov ax, [es:mi.ModeAttributes]
|
||||
mov [es:bx+4], ax ; +4[2] : attributes
|
||||
|
||||
cmp [s_vesa.ver], '2'
|
||||
; jb .lp1
|
||||
jb @f ; We do not use Vesa 1.2 mode is now
|
||||
|
||||
or cx, 0x4000 ; use LFB
|
||||
.lp1: mov [es:bx+6],cx ; +6 : mode number
|
||||
movzx ax,byte [es:mi.BitsPerPixel]
|
||||
mov word [es:bx+8],ax ; +8 : bits per pixel
|
||||
add bx,size_of_step ; size of record
|
||||
.lp1:
|
||||
mov [es:bx+6], cx ; +6 : mode number
|
||||
movzx ax, byte [es:mi.BitsPerPixel]
|
||||
mov word [es:bx+8], ax ; +8 : bits per pixel
|
||||
add bx, size_of_step ; size of record
|
||||
|
||||
@@:
|
||||
add si,2
|
||||
add si, 2
|
||||
jmp .next_mode
|
||||
|
||||
.modes_ok.2:
|
||||
|
||||
mov word[es:bx],-1 ;end video table
|
||||
mov word[end_cursor],bx ;save end cursor position
|
||||
mov word[es:bx], -1 ;end video table
|
||||
mov word[end_cursor], bx ;save end cursor position
|
||||
;;;;;;;;;;;;;;;;;;
|
||||
;Sort array
|
||||
; mov si,modes_table
|
||||
@ -307,28 +310,36 @@ draw_current_vmode:
|
||||
push 0
|
||||
pop es
|
||||
|
||||
mov si,word [cursor_pos]
|
||||
mov si, word [cursor_pos]
|
||||
|
||||
cmp word [es:si+6],0x12
|
||||
cmp word [es:si+6], 0x12
|
||||
je .no_vesa_0x12
|
||||
|
||||
cmp word [es:si+6],0x13
|
||||
cmp word [es:si+6], 0x13
|
||||
je .no_vesa_0x13
|
||||
|
||||
mov di,loader_block_error
|
||||
movzx eax,word[es:si+0]
|
||||
mov ecx,10
|
||||
if defined extended_primary_loader
|
||||
mov di, config_file_variables
|
||||
else
|
||||
mov di, loader_block_error
|
||||
end if
|
||||
movzx eax, word[es:si+0]
|
||||
mov ecx, 10
|
||||
call int2strnz
|
||||
mov byte[es:di],'x'
|
||||
mov byte[es:di], 'x'
|
||||
inc di
|
||||
movzx eax,word[es:si+2]
|
||||
movzx eax, word[es:si+2]
|
||||
call int2strnz
|
||||
mov byte[es:di],'x'
|
||||
mov byte[es:di], 'x'
|
||||
inc di
|
||||
movzx eax,word[es:si+8]
|
||||
movzx eax, word[es:si+8]
|
||||
call int2strnz
|
||||
mov dword[es:di],0x00000d0a
|
||||
mov si,loader_block_error
|
||||
mov dword[es:di], 0x00000d0a
|
||||
if defined extended_primary_loader
|
||||
mov si, config_file_variables
|
||||
else
|
||||
mov si, loader_block_error
|
||||
end if
|
||||
push ds
|
||||
push es
|
||||
pop ds
|
||||
@ -336,18 +347,44 @@ draw_current_vmode:
|
||||
pop ds
|
||||
ret
|
||||
.no_vesa_0x13:
|
||||
mov si,mode0
|
||||
mov si, mode0
|
||||
jmp .print
|
||||
.no_vesa_0x12:
|
||||
mov si,mode9
|
||||
mov si, mode9
|
||||
.print:
|
||||
call printplain
|
||||
ret
|
||||
ret
|
||||
;-----------------------------------------------------------------------------
|
||||
check_first_parm:
|
||||
mov si,word [preboot_graph]
|
||||
test si,si
|
||||
jnz .no_zero ;if no zero
|
||||
if defined extended_primary_loader
|
||||
mov cx, [number_vm]
|
||||
jcxz .novbemode
|
||||
mov si, modes_table
|
||||
.findvbemode:
|
||||
cmp [es:si+6], cx
|
||||
jnz @f
|
||||
cmp word [es:si+8], 32
|
||||
je .ok_found_mode
|
||||
cmp word [es:si+8], 24
|
||||
je .ok_found_mode
|
||||
@@:
|
||||
add si, size_of_step
|
||||
cmp word [es:si], -1
|
||||
jnz .findvbemode
|
||||
.novbemode:
|
||||
mov ax, [x_save]
|
||||
test ax, ax
|
||||
jz .zerro
|
||||
mov bx, [y_save]
|
||||
mov si, modes_table
|
||||
call .loops
|
||||
test ax, ax
|
||||
jz .ok_found_mode
|
||||
else
|
||||
mov si, word [preboot_graph]
|
||||
test si, si
|
||||
jnz .no_zero ;if no zero
|
||||
end if
|
||||
.zerro:
|
||||
; mov ax,modes_table
|
||||
; mov word [cursor_pos],ax
|
||||
@ -355,69 +392,72 @@ check_first_parm:
|
||||
; mov word [preboot_graph],ax
|
||||
;SET default video of mode first probe will fined a move of work 1024x768@32
|
||||
|
||||
mov ax,1024
|
||||
mov bx,768
|
||||
mov si,modes_table
|
||||
mov ax, 1024
|
||||
mov bx, 768
|
||||
mov si, modes_table
|
||||
call .loops
|
||||
test ax,ax
|
||||
jz .ok_found_mode
|
||||
mov ax,800
|
||||
mov bx,600
|
||||
mov si,modes_table
|
||||
test ax, ax
|
||||
jz .ok_found_mode
|
||||
mov ax, 800
|
||||
mov bx, 600
|
||||
mov si, modes_table
|
||||
call .loops
|
||||
test ax,ax
|
||||
jz .ok_found_mode
|
||||
mov ax,640
|
||||
mov bx,480
|
||||
mov si,modes_table
|
||||
test ax, ax
|
||||
jz .ok_found_mode
|
||||
mov ax, 640
|
||||
mov bx, 480
|
||||
mov si, modes_table
|
||||
call .loops
|
||||
test ax,ax
|
||||
jz .ok_found_mode
|
||||
test ax, ax
|
||||
jz .ok_found_mode
|
||||
|
||||
mov si,modes_table
|
||||
mov si, modes_table
|
||||
if ~ defined extended_primary_loader
|
||||
jmp .ok_found_mode
|
||||
|
||||
|
||||
|
||||
.no_zero:
|
||||
mov bp,word [number_vm]
|
||||
cmp bp,word [es:si+6]
|
||||
mov bp, word [number_vm]
|
||||
cmp bp, word [es:si+6]
|
||||
jz .ok_found_mode
|
||||
mov ax,word [x_save]
|
||||
mov bx,word [y_save]
|
||||
mov si,modes_table
|
||||
mov ax, word [x_save]
|
||||
mov bx, word [y_save]
|
||||
mov si, modes_table
|
||||
call .loops
|
||||
test ax,ax
|
||||
jz .ok_found_mode
|
||||
test ax, ax
|
||||
jz .ok_found_mode
|
||||
|
||||
mov si,modes_table
|
||||
mov si, modes_table
|
||||
; cmp ax,modes_table
|
||||
; jb .zerro ;check on correct if bellow
|
||||
; cmp ax,word [end_cursor]
|
||||
; ja .zerro ;check on correct if anymore
|
||||
end if
|
||||
|
||||
.ok_found_mode:
|
||||
mov word [home_cursor],si
|
||||
mov word [home_cursor], si
|
||||
; mov word [cursor_pos],si
|
||||
mov word [preboot_graph],si
|
||||
mov ax,si
|
||||
mov word [preboot_graph], si
|
||||
mov ax, si
|
||||
|
||||
mov ecx,long_v_table
|
||||
mov ecx, long_v_table
|
||||
|
||||
.loop: add ax,size_of_step
|
||||
cmp ax,word [end_cursor]
|
||||
.loop:
|
||||
add ax, size_of_step
|
||||
cmp ax, word [end_cursor]
|
||||
jae .next_step
|
||||
loop .loop
|
||||
.next_step:
|
||||
sub ax,size_of_step*long_v_table
|
||||
cmp ax,modes_table
|
||||
sub ax, size_of_step*long_v_table
|
||||
cmp ax, modes_table
|
||||
jae @f
|
||||
mov ax,modes_table
|
||||
mov ax, modes_table
|
||||
@@:
|
||||
|
||||
mov word [home_cursor],ax
|
||||
mov si,[preboot_graph]
|
||||
mov word [cursor_pos],si
|
||||
mov word [home_cursor], ax
|
||||
mov si, [preboot_graph]
|
||||
mov word [cursor_pos], si
|
||||
|
||||
push word [es:si]
|
||||
pop word [x_save]
|
||||
@ -429,21 +469,24 @@ check_first_parm:
|
||||
ret
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
.loops:
|
||||
cmp ax,word [es:si]
|
||||
cmp ax, word [es:si]
|
||||
jne .next
|
||||
cmp bx,word [es:si+2]
|
||||
cmp bx, word [es:si+2]
|
||||
jne .next
|
||||
cmp word [es:si+8],32
|
||||
cmp word [es:si+8], 32
|
||||
je .ok
|
||||
cmp word [es:si+8],24
|
||||
cmp word [es:si+8], 24
|
||||
je .ok
|
||||
.next: add si,size_of_step
|
||||
cmp word [es:si],-1
|
||||
.next:
|
||||
add si, size_of_step
|
||||
cmp word [es:si], -1
|
||||
je .exit
|
||||
jmp .loops
|
||||
.ok: xor ax,ax
|
||||
.ok:
|
||||
xor ax, ax
|
||||
ret
|
||||
.exit: or ax,-1
|
||||
.exit:
|
||||
or ax, -1
|
||||
ret
|
||||
|
||||
|
||||
@ -454,40 +497,41 @@ check_first_parm:
|
||||
;-----------------------------------------------------------------------------
|
||||
draw_vmodes_table:
|
||||
_setcursor 9, 2
|
||||
mov si,gr_mode
|
||||
mov si, gr_mode
|
||||
call printplain
|
||||
|
||||
mov si,_st
|
||||
mov si, _st
|
||||
call printplain
|
||||
|
||||
push word [cursor_pos]
|
||||
pop ax
|
||||
push word [home_cursor]
|
||||
pop si
|
||||
mov cx,si
|
||||
mov cx, si
|
||||
|
||||
cmp ax,si
|
||||
cmp ax, si
|
||||
je .ok
|
||||
jb .low
|
||||
|
||||
|
||||
add cx,size_of_step*long_v_table
|
||||
add cx, size_of_step*long_v_table
|
||||
|
||||
cmp ax,cx
|
||||
cmp ax, cx
|
||||
jb .ok
|
||||
|
||||
sub cx,size_of_step*long_v_table
|
||||
add cx,size_of_step
|
||||
cmp cx,word[end_cursor]
|
||||
sub cx, size_of_step*long_v_table
|
||||
add cx, size_of_step
|
||||
cmp cx, word[end_cursor]
|
||||
jae .ok
|
||||
add si,size_of_step
|
||||
add si, size_of_step
|
||||
push si
|
||||
pop word [home_cursor]
|
||||
jmp .ok
|
||||
|
||||
|
||||
.low: sub cx,size_of_step
|
||||
cmp cx,modes_table
|
||||
.low:
|
||||
sub cx, size_of_step
|
||||
cmp cx, modes_table
|
||||
jb .ok
|
||||
push cx
|
||||
push cx
|
||||
@ -540,52 +584,52 @@ draw_vmodes_table:
|
||||
add ax, cx
|
||||
mov [scroll_end], ax
|
||||
pop si
|
||||
mov bp,long_v_table ;show rows
|
||||
mov bp, long_v_table ;show rows
|
||||
.@@_next_bit:
|
||||
;clear cursor
|
||||
mov ax,' '
|
||||
mov word[ds:_r1+21],ax
|
||||
mov word[ds:_r1+50],ax
|
||||
mov ax, ' '
|
||||
mov word[ds:_r1+21], ax
|
||||
mov word[ds:_r1+50], ax
|
||||
|
||||
mov word[ds:_r2+21],ax
|
||||
mov word[ds:_r2+45],ax
|
||||
mov word[ds:_r2+21], ax
|
||||
mov word[ds:_r2+45], ax
|
||||
|
||||
mov word[ds:_rs+21],ax
|
||||
mov word[ds:_rs+46],ax
|
||||
mov word[ds:_rs+21], ax
|
||||
mov word[ds:_rs+46], ax
|
||||
; draw string
|
||||
cmp word [es:si+6],0x12
|
||||
cmp word [es:si+6], 0x12
|
||||
je .show_0x12
|
||||
cmp word [es:si+6],0x13
|
||||
cmp word [es:si+6], 0x13
|
||||
je .show_0x13
|
||||
|
||||
movzx eax,word[es:si]
|
||||
cmp ax,-1
|
||||
movzx eax, word[es:si]
|
||||
cmp ax, -1
|
||||
je .@@_end
|
||||
mov di,_rs+23
|
||||
mov ecx,10
|
||||
mov bl,4
|
||||
mov di, _rs+23
|
||||
mov ecx, 10
|
||||
mov bl, 4
|
||||
call int2str
|
||||
movzx eax,word[es:si+2]
|
||||
movzx eax, word[es:si+2]
|
||||
inc di
|
||||
mov bl,4
|
||||
mov bl, 4
|
||||
call int2str
|
||||
|
||||
movzx eax,word[es:si+8]
|
||||
movzx eax, word[es:si+8]
|
||||
inc di
|
||||
mov bl,2
|
||||
mov bl, 2
|
||||
call int2str
|
||||
|
||||
cmp si, word [cursor_pos]
|
||||
jne .next
|
||||
;draw cursor
|
||||
mov word[ds:_rs+21],'>>'
|
||||
mov word[ds:_rs+46],'<<'
|
||||
mov word[ds:_rs+21], '>>'
|
||||
mov word[ds:_rs+46], '<<'
|
||||
|
||||
|
||||
|
||||
.next:
|
||||
push si
|
||||
mov si,_rs
|
||||
mov si, _rs
|
||||
.@@_sh:
|
||||
; add to the string pseudographics for scrollbar
|
||||
pop bx
|
||||
@ -615,13 +659,13 @@ draw_vmodes_table:
|
||||
@@:
|
||||
call printplain
|
||||
pop si
|
||||
add si,size_of_step
|
||||
add si, size_of_step
|
||||
|
||||
dec bp
|
||||
jnz .@@_next_bit
|
||||
|
||||
.@@_end:
|
||||
mov si,_bt
|
||||
mov si, _bt
|
||||
call printplain
|
||||
ret
|
||||
.show_0x13:
|
||||
@ -629,20 +673,20 @@ draw_vmodes_table:
|
||||
|
||||
cmp si, word [cursor_pos]
|
||||
jne @f
|
||||
mov word[ds:_r1+21],'>>'
|
||||
mov word[ds:_r1+50],'<<'
|
||||
mov word[ds:_r1+21], '>>'
|
||||
mov word[ds:_r1+50], '<<'
|
||||
@@:
|
||||
mov si,_r1
|
||||
mov si, _r1
|
||||
jmp .@@_sh
|
||||
.show_0x12:
|
||||
push si
|
||||
cmp si, word [cursor_pos]
|
||||
jne @f
|
||||
|
||||
mov word[ds:_r2+21],'>>'
|
||||
mov word[ds:_r2+45],'<<'
|
||||
mov word[ds:_r2+21], '>>'
|
||||
mov word[ds:_r2+45], '<<'
|
||||
@@:
|
||||
mov si,_r2
|
||||
mov si, _r2
|
||||
jmp .@@_sh
|
||||
|
||||
;-----------------------------------------------------------------------------
|
||||
@ -653,17 +697,17 @@ clear_vmodes_table:
|
||||
push es
|
||||
push 0xb800
|
||||
pop es
|
||||
mov di,1444
|
||||
xor ax,ax
|
||||
mov di, 1444
|
||||
xor ax, ax
|
||||
mov ah, 1*16+15
|
||||
mov cx,70
|
||||
mov bp,12
|
||||
mov cx, 70
|
||||
mov bp, 12
|
||||
.loop_start:
|
||||
rep stosw
|
||||
mov cx,70
|
||||
add di,20
|
||||
rep stosw
|
||||
mov cx, 70
|
||||
add di, 20
|
||||
dec bp
|
||||
jns .loop_start
|
||||
jns .loop_start
|
||||
pop es
|
||||
popa
|
||||
ret
|
||||
@ -674,11 +718,11 @@ set_vmode:
|
||||
push 0 ;0;x1000
|
||||
pop es
|
||||
|
||||
mov si,word [preboot_graph] ;[preboot_graph]
|
||||
mov cx,word [es:si+6] ; number of mode
|
||||
mov si, word [preboot_graph] ;[preboot_graph]
|
||||
mov cx, word [es:si+6] ; number of mode
|
||||
|
||||
|
||||
mov ax,word [es:si+0] ; resolution X
|
||||
mov ax, word [es:si+0] ; resolution X
|
||||
mov bx, word [es:si+2] ; resolution Y
|
||||
|
||||
|
||||
@ -688,7 +732,7 @@ set_vmode:
|
||||
|
||||
cmp cx, 0x12
|
||||
je .mode0x12_0x13
|
||||
cmp cx,0x13
|
||||
cmp cx, 0x13
|
||||
je .mode0x12_0x13
|
||||
|
||||
|
||||
@ -697,9 +741,9 @@ set_vmode:
|
||||
|
||||
; VESA 2 and Vesa 3
|
||||
|
||||
mov ax,0x4f01
|
||||
and cx,0xfff
|
||||
mov di,mi;0xa000
|
||||
mov ax, 0x4f01
|
||||
and cx, 0xfff
|
||||
mov di, mi;0xa000
|
||||
int 0x10
|
||||
; LFB
|
||||
mov eax, [es:mi.PhysBasePtr];di+0x28]
|
||||
@ -711,7 +755,7 @@ set_vmode:
|
||||
; BPP
|
||||
cmp [es:mi.BitsPerPixel], 16
|
||||
jne .l0
|
||||
cmp [es:mi.GreenMaskSize],5
|
||||
cmp [es:mi.GreenMaskSize], 5
|
||||
jne .l0
|
||||
mov [es:mi.BitsPerPixel], 15
|
||||
.l0:
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
|
||||
|
170
kernel/branches/net/boot/parsers.inc
Normal file
170
kernel/branches/net/boot/parsers.inc
Normal file
@ -0,0 +1,170 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision: 2288 $
|
||||
|
||||
; All parsers are called with ds:si -> value of the variable,
|
||||
; possibly with spaces before, and dx = limit of config file.
|
||||
|
||||
; Three subroutines parse_char, parse_number and parse_bool set CF
|
||||
; if something has failed, otherwise return the value in al/ax.
|
||||
|
||||
parse_timeout:
|
||||
; timeout is a number not greater than 9
|
||||
call parse_number
|
||||
jc .nothing
|
||||
cmp ax, 9
|
||||
jbe @f
|
||||
mov ax, 9
|
||||
@@:
|
||||
imul ax, 18
|
||||
mov [es:preboot_timeout], ax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_resolution:
|
||||
; resolution is <width>*<height>, 'x' can be used instead of '*'
|
||||
; parse width
|
||||
call parse_number
|
||||
jc .nothing
|
||||
; save width
|
||||
xchg ax, bx
|
||||
; test for 'x' or '*'
|
||||
call parse_char
|
||||
cmp al, 'x'
|
||||
jz @f
|
||||
cmp al, '*'
|
||||
jnz .nothing
|
||||
@@:
|
||||
; parse height
|
||||
call parse_number
|
||||
jc .nothing
|
||||
; write width and height
|
||||
mov [es:x_save], bx
|
||||
mov [es:y_save], ax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_vbemode:
|
||||
; vbemode is a number
|
||||
call parse_number
|
||||
jc .nothing
|
||||
mov [es:number_vm], ax
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
;parse_vrr:
|
||||
;; vrr is a boolean setting
|
||||
; call parse_bool
|
||||
; jc .nothing
|
||||
;; convert 0 to 2, 1 to 1
|
||||
; inc ax
|
||||
; xor al, 3
|
||||
; mov [es:preboot_vrrm], al
|
||||
;.nothing:
|
||||
; ret
|
||||
|
||||
parse_biosdisks:
|
||||
; using biosdisks is a boolean setting
|
||||
call parse_bool
|
||||
jc .nothing
|
||||
; convert 0 to 2, 1 to 1
|
||||
inc ax
|
||||
xor al, 3
|
||||
mov [es:preboot_biosdisk], al
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_imgfrom:
|
||||
; boot device (1-floppy 2-kolibri.img using primary loader)
|
||||
call parse_number
|
||||
jc .nothing
|
||||
cmp al, 1
|
||||
jb .nothing
|
||||
cmp al, 2
|
||||
ja .nothing
|
||||
mov [es:preboot_device], al
|
||||
.nothing:
|
||||
ret
|
||||
|
||||
parse_char:
|
||||
; skip spaces and return the next character or CF if EOF.
|
||||
cmp si, dx
|
||||
jae .eof
|
||||
lodsb
|
||||
cmp al, ' '
|
||||
jbe parse_char
|
||||
ret
|
||||
.eof:
|
||||
stc
|
||||
ret
|
||||
|
||||
parse_number:
|
||||
; initialize high part of ax to zero
|
||||
xor ax, ax
|
||||
; skip spaces
|
||||
call parse_char
|
||||
jc .bad
|
||||
; al should be a digit
|
||||
sub al, '0'
|
||||
cmp al, 9
|
||||
ja .bad
|
||||
; accumulate the value in cx
|
||||
xchg cx, ax
|
||||
@@:
|
||||
cmp si, dx
|
||||
jae .eof
|
||||
lodsb
|
||||
sub al, '0'
|
||||
cmp al, 9
|
||||
ja .end
|
||||
imul cx, 10
|
||||
add cx, ax
|
||||
jmp @b
|
||||
; if the end is caused by non-digit, unwind the last character
|
||||
.end:
|
||||
dec si
|
||||
.eof:
|
||||
xchg cx, ax
|
||||
clc
|
||||
ret
|
||||
.bad:
|
||||
stc
|
||||
ret
|
||||
|
||||
parse_bool:
|
||||
; skip spaces
|
||||
call parse_char
|
||||
jc .bad
|
||||
; Boolean false can be represented as 0=no=off,
|
||||
; boolean true can be represented as 1=yes=on.
|
||||
cmp al, '0'
|
||||
jz .false
|
||||
cmp al, '1'
|
||||
jz .true
|
||||
mov ah, al
|
||||
cmp si, dx
|
||||
jae .bad
|
||||
lodsb
|
||||
cmp ax, 'n'*256 + 'o'
|
||||
jz .false
|
||||
cmp ax, 'o'*256 + 'f'
|
||||
jz .false
|
||||
cmp ax, 'y'*256 + 'e'
|
||||
jz .true
|
||||
cmp ax, 'o'*256 + 'n'
|
||||
jz .true
|
||||
.bad:
|
||||
stc
|
||||
ret
|
||||
.true:
|
||||
xor ax, ax
|
||||
inc ax
|
||||
ret
|
||||
.false:
|
||||
xor ax, ax
|
||||
ret
|
@ -23,16 +23,20 @@ y_save dw 0 ; y
|
||||
number_vm dw 0 ;
|
||||
;pixel_save dw 0 ; per to pixel
|
||||
preboot_gprobe db 0 ; probe vesa3 videomodes (1-no, 2-yes)
|
||||
preboot_vrrm db 0 ; use VRR_M (1-yes, 2- no)
|
||||
;preboot_vrrm db 0 ; use VRR_M (1-yes, 2- no)
|
||||
preboot_dma db 0 ; use DMA for access to HDD (1-always, 2-only for read, 3-never)
|
||||
preboot_device db 0 ; boot device
|
||||
; (1-floppy 2-harddisk 3-kernel restart 4-format ram disk)
|
||||
;!!!! 0 - autodetect !!!!
|
||||
preboot_blogesc = 0 ; start immediately after bootlog
|
||||
preboot_biosdisk db 0 ; use V86 to access disks through BIOS (1-yes, 2-no)
|
||||
if defined extended_primary_loader
|
||||
preboot_timeout dw 5*18 ; timeout in 1/18th of second for config settings screen
|
||||
end if
|
||||
|
||||
if $>0x200
|
||||
ERROR: prebooting parameters must fit in first sector!!!
|
||||
end if
|
||||
hdsysimage db 'KOLIBRI IMG' ; load from
|
||||
image_save db 'KOLIBRI IMG' ; save to
|
||||
ERROR:
|
||||
prebooting parameters must fit in first sector!!!
|
||||
end if
|
||||
hdsysimage db 'KOLIBRI.IMG',0 ; load from
|
||||
image_save db 'KOLIBRI.IMG',0 ; save to
|
||||
|
@ -10,125 +10,125 @@ $Revision $
|
||||
|
||||
; READ RAMDISK IMAGE FROM HD
|
||||
|
||||
cmp [boot_dev+OS_BASE+0x10000],1
|
||||
jne no_sys_on_hd
|
||||
cmp [boot_dev+OS_BASE+0x10000], 1
|
||||
jne no_sys_on_hd
|
||||
|
||||
test [DRIVE_DATA+1],byte 0x40
|
||||
jz position_2
|
||||
mov [hdbase],0x1f0
|
||||
mov [hdid],0x0
|
||||
mov [hdpos],1
|
||||
mov [fat32part],0
|
||||
test [DRIVE_DATA+1], byte 0x40
|
||||
jz position_2
|
||||
mov [hdbase], 0x1f0
|
||||
mov [hdid], 0x0
|
||||
mov [hdpos], 1
|
||||
mov [fat32part], 0
|
||||
position_1_1:
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved],1
|
||||
je yes_sys_on_hd
|
||||
movzx eax,byte [DRIVE_DATA+2]
|
||||
cmp [fat32part],eax
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved], 1
|
||||
je yes_sys_on_hd
|
||||
movzx eax, byte [DRIVE_DATA+2]
|
||||
cmp [fat32part], eax
|
||||
jle position_1_1
|
||||
position_2:
|
||||
test [DRIVE_DATA+1],byte 0x10
|
||||
jz position_3
|
||||
mov [hdbase],0x1f0
|
||||
mov [hdid],0x10
|
||||
mov [hdpos],2
|
||||
mov [fat32part],0
|
||||
test [DRIVE_DATA+1], byte 0x10
|
||||
jz position_3
|
||||
mov [hdbase], 0x1f0
|
||||
mov [hdid], 0x10
|
||||
mov [hdpos], 2
|
||||
mov [fat32part], 0
|
||||
position_2_1:
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved],1
|
||||
je yes_sys_on_hd
|
||||
movzx eax,byte [DRIVE_DATA+3]
|
||||
cmp eax,[fat32part]
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved], 1
|
||||
je yes_sys_on_hd
|
||||
movzx eax, byte [DRIVE_DATA+3]
|
||||
cmp eax, [fat32part]
|
||||
jle position_2_1
|
||||
position_3:
|
||||
test [DRIVE_DATA+1],byte 0x4
|
||||
jz position_4
|
||||
mov [hdbase],0x170
|
||||
mov [hdid],0x0
|
||||
mov [hdpos],3
|
||||
mov [fat32part],0
|
||||
test [DRIVE_DATA+1], byte 0x4
|
||||
jz position_4
|
||||
mov [hdbase], 0x170
|
||||
mov [hdid], 0x0
|
||||
mov [hdpos], 3
|
||||
mov [fat32part], 0
|
||||
position_3_1:
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved],1
|
||||
je yes_sys_on_hd
|
||||
movzx eax,byte [DRIVE_DATA+4]
|
||||
cmp eax,[fat32part]
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved], 1
|
||||
je yes_sys_on_hd
|
||||
movzx eax, byte [DRIVE_DATA+4]
|
||||
cmp eax, [fat32part]
|
||||
jle position_3_1
|
||||
position_4:
|
||||
test [DRIVE_DATA+1],byte 0x1
|
||||
jz no_sys_on_hd
|
||||
mov [hdbase],0x170
|
||||
mov [hdid],0x10
|
||||
mov [hdpos],4
|
||||
mov [fat32part],0
|
||||
test [DRIVE_DATA+1], byte 0x1
|
||||
jz no_sys_on_hd
|
||||
mov [hdbase], 0x170
|
||||
mov [hdid], 0x10
|
||||
mov [hdpos], 4
|
||||
mov [fat32part], 0
|
||||
position_4_1:
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved],1
|
||||
je yes_sys_on_hd
|
||||
movzx eax,byte [DRIVE_DATA+5]
|
||||
cmp eax,[fat32part]
|
||||
inc [fat32part]
|
||||
call search_and_read_image
|
||||
cmp [image_retrieved], 1
|
||||
je yes_sys_on_hd
|
||||
movzx eax, byte [DRIVE_DATA+5]
|
||||
cmp eax, [fat32part]
|
||||
jle position_4_1
|
||||
jmp yes_sys_on_hd
|
||||
jmp yes_sys_on_hd
|
||||
|
||||
search_and_read_image:
|
||||
call set_FAT32_variables
|
||||
mov edx, bootpath
|
||||
call read_image
|
||||
test eax, eax
|
||||
jz image_present
|
||||
mov edx, bootpath2
|
||||
call read_image
|
||||
test eax, eax
|
||||
jz image_present
|
||||
call set_FAT32_variables
|
||||
mov edx, bootpath
|
||||
call read_image
|
||||
test eax, eax
|
||||
jz image_present
|
||||
mov edx, bootpath2
|
||||
call read_image
|
||||
test eax, eax
|
||||
jz image_present
|
||||
ret
|
||||
image_present:
|
||||
mov [image_retrieved], 1
|
||||
ret
|
||||
|
||||
iglobal
|
||||
align 4
|
||||
read_image_fsinfo:
|
||||
dd 0 ; function: read
|
||||
dq 0 ; offset: zero
|
||||
dd 1474560/512 ; size
|
||||
dd RAMDISK ; buffer
|
||||
db 0
|
||||
dd hdsysimage+OS_BASE+0x10000
|
||||
endg
|
||||
|
||||
read_image:
|
||||
mov ebx, read_image_fsinfo
|
||||
pushad
|
||||
call file_system_lfn
|
||||
popad
|
||||
ret
|
||||
|
||||
image_retrieved db 0
|
||||
mov [image_retrieved], 1
|
||||
ret
|
||||
|
||||
iglobal
|
||||
align 4
|
||||
read_image_fsinfo:
|
||||
dd 0 ; function: read
|
||||
dq 0 ; offset: zero
|
||||
dd 1474560/512 ; size
|
||||
dd RAMDISK ; buffer
|
||||
db 0
|
||||
dd hdsysimage+OS_BASE+0x10000
|
||||
endg
|
||||
|
||||
read_image:
|
||||
mov ebx, read_image_fsinfo
|
||||
pushad
|
||||
call file_system_lfn_protected
|
||||
popad
|
||||
ret
|
||||
|
||||
image_retrieved db 0
|
||||
counter_of_partitions db 0
|
||||
no_sys_on_hd:
|
||||
; test_to_format_ram_disk (need if not using ram disk)
|
||||
cmp [boot_dev+OS_BASE+0x10000],3
|
||||
jne not_format_ram_disk
|
||||
cmp [boot_dev+OS_BASE+0x10000], 3
|
||||
jne not_format_ram_disk
|
||||
; format_ram_disk
|
||||
mov edi, RAMDISK
|
||||
mov ecx, 0x1080
|
||||
xor eax,eax
|
||||
mov edi, RAMDISK
|
||||
mov ecx, 0x1080
|
||||
xor eax, eax
|
||||
@@:
|
||||
stosd
|
||||
loop @b
|
||||
stosd
|
||||
loop @b
|
||||
|
||||
mov ecx, 0x58F7F
|
||||
mov eax,0xF6F6F6F6
|
||||
mov ecx, 0x58F7F
|
||||
mov eax, 0xF6F6F6F6
|
||||
@@:
|
||||
stosd
|
||||
loop @b
|
||||
stosd
|
||||
loop @b
|
||||
|
||||
mov [RAMDISK+0x200],dword 0xFFFFF0 ; fat table
|
||||
mov [RAMDISK+0x4200],dword 0xFFFFF0
|
||||
mov [RAMDISK+0x200], dword 0xFFFFF0 ; fat table
|
||||
mov [RAMDISK+0x4200], dword 0xFFFFF0
|
||||
|
||||
not_format_ram_disk:
|
||||
yes_sys_on_hd:
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
|
||||
|
@ -18,92 +18,94 @@ align 4
|
||||
pr_mode_exit:
|
||||
|
||||
; setup stack
|
||||
mov ax, 0x3000
|
||||
mov ss, ax
|
||||
mov esp, 0x0EC00
|
||||
mov ax, 0x3000
|
||||
mov ss, ax
|
||||
mov esp, 0x0EC00
|
||||
; setup ds
|
||||
push cs
|
||||
pop ds
|
||||
pop ds
|
||||
|
||||
lidt [old_ints_h]
|
||||
lidt [old_ints_h]
|
||||
;remap IRQs
|
||||
mov al,0x11
|
||||
out 0x20,al
|
||||
call rdelay
|
||||
out 0xA0,al
|
||||
call rdelay
|
||||
mov al, 0x11
|
||||
out 0x20, al
|
||||
call rdelay
|
||||
out 0xA0, al
|
||||
call rdelay
|
||||
|
||||
mov al,0x08
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
mov al,0x70
|
||||
out 0xA1,al
|
||||
call rdelay
|
||||
mov al, 0x08
|
||||
out 0x21, al
|
||||
call rdelay
|
||||
mov al, 0x70
|
||||
out 0xA1, al
|
||||
call rdelay
|
||||
|
||||
mov al,0x04
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
mov al,0x02
|
||||
out 0xA1,al
|
||||
call rdelay
|
||||
mov al, 0x04
|
||||
out 0x21, al
|
||||
call rdelay
|
||||
mov al, 0x02
|
||||
out 0xA1, al
|
||||
call rdelay
|
||||
|
||||
mov al,0x01
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
out 0xA1,al
|
||||
call rdelay
|
||||
mov al, 0x01
|
||||
out 0x21, al
|
||||
call rdelay
|
||||
out 0xA1, al
|
||||
call rdelay
|
||||
|
||||
mov al,0xB8
|
||||
out 0x21,al
|
||||
call rdelay
|
||||
mov al,0xBD
|
||||
out 0xA1,al
|
||||
mov al, 0xB8
|
||||
out 0x21, al
|
||||
call rdelay
|
||||
mov al, 0xBD
|
||||
out 0xA1, al
|
||||
sti
|
||||
|
||||
temp_3456:
|
||||
xor ax,ax
|
||||
mov es,ax
|
||||
mov al,byte [es:0x9030]
|
||||
cmp al,1
|
||||
jl nbw
|
||||
cmp al,4
|
||||
jle nbw32
|
||||
xor ax, ax
|
||||
mov es, ax
|
||||
mov al, byte [es:0x9030]
|
||||
cmp al, 1
|
||||
jl nbw
|
||||
cmp al, 4
|
||||
jle nbw32
|
||||
|
||||
nbw:
|
||||
in al,0x60
|
||||
cmp al,6
|
||||
jae nbw
|
||||
mov bl,al
|
||||
in al, 0x60
|
||||
cmp al, 6
|
||||
jae nbw
|
||||
mov bl, al
|
||||
nbw2:
|
||||
in al,0x60
|
||||
cmp al,bl
|
||||
je nbw2
|
||||
cmp al,240 ;ax,240
|
||||
jne nbw31
|
||||
mov al,bl
|
||||
dec ax
|
||||
jmp nbw32
|
||||
in al, 0x60
|
||||
cmp al, bl
|
||||
je nbw2
|
||||
cmp al, 240;ax,240
|
||||
jne nbw31
|
||||
mov al, bl
|
||||
dec ax
|
||||
jmp nbw32
|
||||
nbw31:
|
||||
add bl,128
|
||||
cmp al,bl
|
||||
jne nbw
|
||||
sub al,129
|
||||
add bl, 128
|
||||
cmp al, bl
|
||||
jne nbw
|
||||
sub al, 129
|
||||
|
||||
nbw32:
|
||||
|
||||
dec ax
|
||||
dec ax ; 2 = power off
|
||||
jnz no_apm_off
|
||||
call APM_PowerOff
|
||||
jmp $
|
||||
dec ax
|
||||
dec ax ; 2 = power off
|
||||
jnz no_apm_off
|
||||
call APM_PowerOff
|
||||
jmp $
|
||||
no_apm_off:
|
||||
|
||||
dec ax ; 3 = reboot
|
||||
jnz restart_kernel ; 4 = restart kernel
|
||||
push 0x40
|
||||
pop ds
|
||||
mov word[0x0072],0x1234
|
||||
jmp 0xF000:0xFFF0
|
||||
if ~ defined extended_primary_loader ; kernel restarting is not supported
|
||||
dec ax ; 3 = reboot
|
||||
jnz restart_kernel ; 4 = restart kernel
|
||||
end if
|
||||
push 0x40
|
||||
pop ds
|
||||
mov word[0x0072], 0x1234
|
||||
jmp 0xF000:0xFFF0
|
||||
|
||||
|
||||
rdelay:
|
||||
@ -114,45 +116,46 @@ APM_PowerOff:
|
||||
xor bx, bx
|
||||
int 15h
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
mov ax,0x5300
|
||||
xor bx,bx
|
||||
int 0x15
|
||||
push ax
|
||||
mov ax, 0x5300
|
||||
xor bx, bx
|
||||
int 0x15
|
||||
push ax
|
||||
|
||||
mov ax,0x5301
|
||||
xor bx,bx
|
||||
int 0x15
|
||||
mov ax, 0x5301
|
||||
xor bx, bx
|
||||
int 0x15
|
||||
|
||||
mov ax,0x5308
|
||||
mov bx,1
|
||||
mov cx,bx
|
||||
int 0x15
|
||||
mov ax, 0x5308
|
||||
mov bx, 1
|
||||
mov cx, bx
|
||||
int 0x15
|
||||
|
||||
mov ax,0x530E
|
||||
xor bx,bx
|
||||
pop cx
|
||||
int 0x15
|
||||
mov ax, 0x530E
|
||||
xor bx, bx
|
||||
pop cx
|
||||
int 0x15
|
||||
|
||||
mov ax,0x530D
|
||||
mov bx,1
|
||||
mov cx,bx
|
||||
int 0x15
|
||||
mov ax, 0x530D
|
||||
mov bx, 1
|
||||
mov cx, bx
|
||||
int 0x15
|
||||
|
||||
mov ax,0x530F
|
||||
mov bx,1
|
||||
mov cx,bx
|
||||
int 0x15
|
||||
mov ax, 0x530F
|
||||
mov bx, 1
|
||||
mov cx, bx
|
||||
int 0x15
|
||||
|
||||
mov ax,0x5307
|
||||
mov bx,1
|
||||
mov cx,3
|
||||
int 0x15
|
||||
mov ax, 0x5307
|
||||
mov bx, 1
|
||||
mov cx, 3
|
||||
int 0x15
|
||||
;!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
ret
|
||||
|
||||
if ~ defined extended_primary_loader
|
||||
restart_kernel:
|
||||
|
||||
mov ax,0x0003 ; set text mode for screen
|
||||
mov ax, 0x0003 ; set text mode for screen
|
||||
int 0x10
|
||||
jmp 0x4000:0000
|
||||
|
||||
@ -167,28 +170,28 @@ restart_kernel_4000:
|
||||
pop ds
|
||||
xor si, si
|
||||
xor di, di
|
||||
rep movsw
|
||||
rep movsw
|
||||
pop cx
|
||||
mov ds, cx
|
||||
push 0x2000
|
||||
pop es
|
||||
rep movsw
|
||||
rep movsw
|
||||
push 0x9000
|
||||
pop ds
|
||||
push 0x3000
|
||||
pop es
|
||||
mov cx, 0xE000/2
|
||||
rep movsw
|
||||
rep movsw
|
||||
|
||||
wbinvd ; write and invalidate cache
|
||||
|
||||
mov al, 00110100b
|
||||
out 43h, al
|
||||
mov al, 00110100b
|
||||
out 43h, al
|
||||
jcxz $+2
|
||||
mov al, 0xFF
|
||||
out 40h, al
|
||||
mov al, 0xFF
|
||||
out 40h, al
|
||||
jcxz $+2
|
||||
out 40h, al
|
||||
out 40h, al
|
||||
jcxz $+2
|
||||
sti
|
||||
|
||||
@ -201,9 +204,9 @@ restart_kernel_4000:
|
||||
|
||||
; bootloader interface
|
||||
push 0x1000
|
||||
pop ds
|
||||
mov si, kernel_restart_bootblock
|
||||
mov ax, 'KL'
|
||||
pop ds
|
||||
mov si, kernel_restart_bootblock
|
||||
mov ax, 'KL'
|
||||
jmp 0x1000:0000
|
||||
|
||||
end if
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2010-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2010-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; ;;
|
||||
;; PCIe.INC ;;
|
||||
;; ;;
|
||||
;; Extended PCI express services ;;
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
||||
iglobal
|
||||
@ -58,13 +58,13 @@ APIC_init:
|
||||
mov [acpi_dev_data], eax
|
||||
mov [acpi_dev_size], ebx
|
||||
|
||||
call IRQ_mask_all
|
||||
|
||||
; IOAPIC init
|
||||
stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SW+PG_NOCACHE
|
||||
mov [IOAPIC_base], eax
|
||||
|
||||
mov eax, IOAPIC_VER
|
||||
call IRQ_mask_all
|
||||
|
||||
; IOAPIC init
|
||||
stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SW+PG_NOCACHE
|
||||
mov [IOAPIC_base], eax
|
||||
|
||||
mov eax, IOAPIC_VER
|
||||
call IOAPIC_read
|
||||
shr eax, 16
|
||||
inc al
|
||||
@ -118,17 +118,17 @@ APIC_init:
|
||||
|
||||
ret
|
||||
|
||||
;===========================================================
|
||||
align 4
|
||||
LAPIC_init:
|
||||
|
||||
cmp [LAPIC_BASE], 0
|
||||
jne .done
|
||||
|
||||
stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW+PG_NOCACHE
|
||||
mov [LAPIC_BASE], eax
|
||||
mov esi, eax
|
||||
|
||||
;===========================================================
|
||||
align 4
|
||||
LAPIC_init:
|
||||
|
||||
cmp [LAPIC_BASE], 0
|
||||
jne .done
|
||||
|
||||
stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW+PG_NOCACHE
|
||||
mov [LAPIC_BASE], eax
|
||||
mov esi, eax
|
||||
|
||||
; Program Destination Format Register for Flat mode.
|
||||
mov eax, [esi + APIC_DFR]
|
||||
or eax, 0xf0000000
|
||||
@ -194,14 +194,14 @@ LAPIC_init:
|
||||
xor eax, 0xffffffff ; eax = 0xffffffff - eax
|
||||
shr eax, 6 ; eax /= 64; APIC ticks per 0.01 sec
|
||||
|
||||
; Start (every 0.01 sec)
|
||||
mov dword[esi + APIC_LVT_timer], 0x30020; periodic int 0x20
|
||||
mov dword[esi + APIC_timer_init], eax
|
||||
|
||||
.done:
|
||||
ret
|
||||
|
||||
;===========================================================
|
||||
; Start (every 0.01 sec)
|
||||
mov dword[esi + APIC_LVT_timer], 0x30020; periodic int 0x20
|
||||
mov dword[esi + APIC_timer_init], eax
|
||||
|
||||
.done:
|
||||
ret
|
||||
|
||||
;===========================================================
|
||||
; IOAPIC implementation
|
||||
align 4
|
||||
IOAPIC_read:
|
||||
@ -371,6 +371,33 @@ proc enable_irq stdcall, irq_line:dword
|
||||
ret
|
||||
endp
|
||||
|
||||
proc disable_irq stdcall, irq_line:dword
|
||||
mov ebx, [irq_line]
|
||||
cmp [irq_mode], IRQ_APIC
|
||||
je .APIC
|
||||
|
||||
mov edx, 0x21
|
||||
cmp ebx, 8
|
||||
jb @F
|
||||
|
||||
mov edx, 0xA1
|
||||
sub ebx, 8
|
||||
@@:
|
||||
in al, dx
|
||||
bts eax, ebx
|
||||
out dx, al
|
||||
ret
|
||||
.APIC:
|
||||
shl ebx, 1
|
||||
add ebx, 0x10
|
||||
mov eax, ebx
|
||||
call IOAPIC_read
|
||||
or eax, 0x10000; bit 16
|
||||
xchg eax, ebx
|
||||
call IOAPIC_write
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
pci_irq_fixup:
|
||||
|
||||
|
11
kernel/branches/net/core/conf_lib-sp.inc
Normal file
11
kernel/branches/net/core/conf_lib-sp.inc
Normal file
@ -0,0 +1,11 @@
|
||||
; <EFBFBD>ste archivo debe ser editado con codificaci¢n CP866
|
||||
|
||||
ugui_mouse_speed db 'velocidad del rat¢n',0
|
||||
ugui_mouse_delay db 'demora del rat¢n',0
|
||||
|
||||
udev db 'disp',0
|
||||
unet db 'red',0
|
||||
unet_active db 'activa',0
|
||||
unet_addr db 'direc',0
|
||||
unet_mask db 'm sc',0
|
||||
unet_gate db 'puer',0
|
@ -67,16 +67,27 @@ proc set_kernel_conf
|
||||
endp
|
||||
iglobal
|
||||
ugui db 'gui',0
|
||||
ugui_mouse_speed db 'mouse_speed',0
|
||||
ugui_mouse_speed_def db '2',0
|
||||
ugui_mouse_delay db 'mouse_delay',0
|
||||
ugui_mouse_delay_def db '0x00A',0
|
||||
|
||||
udev db 'dev',0
|
||||
udev_midibase db 'midibase',0
|
||||
udev_midibase_def db '0x320',0
|
||||
endg
|
||||
|
||||
iglobal
|
||||
if lang eq sp
|
||||
include 'core/conf_lib-sp.inc'
|
||||
else
|
||||
ugui_mouse_speed db 'mouse_speed',0
|
||||
ugui_mouse_delay db 'mouse_delay',0
|
||||
udev db 'dev',0
|
||||
unet db 'net',0
|
||||
unet_active db 'active',0
|
||||
unet_addr db 'addr',0
|
||||
unet_mask db 'mask',0
|
||||
unet_gate db 'gate',0
|
||||
end if
|
||||
unet_def db 0
|
||||
endg
|
||||
; convert string to DWord
|
||||
proc strtoint stdcall,strs
|
||||
pushad
|
||||
|
@ -369,7 +369,7 @@ proc read_file stdcall,file_name:dword, buffer:dword, off:dword,\
|
||||
|
||||
pushad
|
||||
lea ebx, [cmd]
|
||||
call file_system_lfn
|
||||
call file_system_lfn_protected
|
||||
popad
|
||||
ret
|
||||
endp
|
||||
@ -807,13 +807,13 @@ proc load_driver stdcall, driver_name:dword
|
||||
mov ebx, [start]
|
||||
stdcall ebx, DRV_ENTRY
|
||||
test eax, eax
|
||||
jnz .ok
|
||||
|
||||
stdcall kernel_free, [img_base]
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
.ok:
|
||||
jnz .ok
|
||||
|
||||
stdcall kernel_free, [img_base]
|
||||
|
||||
xor eax, eax
|
||||
ret
|
||||
.ok:
|
||||
mov ebx, [img_base]
|
||||
mov [eax+SRV.base], ebx
|
||||
mov ecx, [start]
|
||||
|
@ -54,7 +54,7 @@ md:
|
||||
inc [mem_hash_cnt+eax*4]
|
||||
|
||||
lea ecx, [mem_used_list+eax*8]
|
||||
list_add esi, ecx
|
||||
list_add esi, ecx
|
||||
mov [esi+block_flags], USED_BLOCK
|
||||
mov eax, [esi+block_size]
|
||||
sub [heap_free], eax
|
||||
@ -95,7 +95,7 @@ align 4
|
||||
jne .fatal
|
||||
|
||||
dec [mem_hash_cnt+ecx*4]
|
||||
list_del esi
|
||||
list_del esi
|
||||
.done:
|
||||
ret
|
||||
.fatal: ;FIXME panic here
|
||||
@ -176,7 +176,7 @@ proc init_kernel_heap
|
||||
mov [mem_block_mask+4], 0x80000000
|
||||
|
||||
mov ecx, mem_block_list+63*8
|
||||
list_add ebx, ecx
|
||||
list_add ebx, ecx
|
||||
|
||||
mov ecx, 4096-3-1
|
||||
mov eax, HEAP_BASE+sizeof.MEM_BLOCK*4
|
||||
@ -393,7 +393,7 @@ proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword
|
||||
cmp [edi+block_flags], FREE_BLOCK
|
||||
jne .prev
|
||||
|
||||
list_del edi
|
||||
list_del edi
|
||||
|
||||
mov edx, [edi+block_next]
|
||||
mov [esi+block_next], edx
|
||||
@ -401,7 +401,7 @@ proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword
|
||||
mov ecx, [edi+block_size]
|
||||
add [esi+block_size], ecx
|
||||
|
||||
calc_index ecx
|
||||
calc_index ecx
|
||||
|
||||
lea edx, [mem_block_list+ecx*8]
|
||||
cmp edx, [edx]
|
||||
@ -427,23 +427,24 @@ proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword
|
||||
add eax, ecx
|
||||
mov [edi+block_size], eax
|
||||
|
||||
calc_index eax ;new index
|
||||
calc_index ecx ;old index
|
||||
calc_index eax ;new index
|
||||
calc_index ecx ;old index
|
||||
cmp eax, ecx
|
||||
je .m_eq
|
||||
|
||||
push ecx
|
||||
list_del edi
|
||||
list_del edi
|
||||
pop ecx
|
||||
|
||||
lea edx, [mem_block_list+ecx*8]
|
||||
cmp edx, [edx]
|
||||
jne .add_block
|
||||
btr [mem_block_mask], ecx
|
||||
|
||||
.add_block:
|
||||
bts [mem_block_mask], eax
|
||||
lea edx, [mem_block_list+eax*8]
|
||||
list_add edi, edx
|
||||
list_add edi, edx
|
||||
.m_eq:
|
||||
mov ecx, heap_mutex
|
||||
call mutex_unlock
|
||||
@ -453,7 +454,7 @@ proc free_kernel_space stdcall uses ebx ecx edx esi edi, base:dword
|
||||
.insert:
|
||||
mov [esi+block_flags], FREE_BLOCK
|
||||
mov eax, [esi+block_size]
|
||||
calc_index eax
|
||||
calc_index eax
|
||||
mov edi, esi
|
||||
jmp .add_block
|
||||
|
||||
@ -466,10 +467,10 @@ endp
|
||||
|
||||
align 4
|
||||
proc kernel_alloc stdcall, size:dword
|
||||
locals
|
||||
lin_addr dd ?
|
||||
pages_count dd ?
|
||||
endl
|
||||
locals
|
||||
lin_addr dd ?
|
||||
pages_count dd ?
|
||||
endl
|
||||
|
||||
push ebx
|
||||
push edi
|
||||
@ -758,11 +759,13 @@ proc user_alloc_at stdcall, address:dword, alloc_size:dword
|
||||
inc ebx
|
||||
dec eax
|
||||
jnz .fill
|
||||
|
||||
.second_nofill:
|
||||
sub ecx, edx
|
||||
jz .nothird
|
||||
or cl, FREE_BLOCK
|
||||
mov [page_tabs+ebx*4], ecx
|
||||
|
||||
.nothird:
|
||||
|
||||
mov edx, [current_slot]
|
||||
@ -822,6 +825,7 @@ proc user_free stdcall, base:dword
|
||||
inc esi
|
||||
dec ecx
|
||||
jnz .release
|
||||
|
||||
.released:
|
||||
push edi
|
||||
|
||||
@ -1288,11 +1292,11 @@ SHM_OPEN_MASK equ (3 shl 2)
|
||||
|
||||
align 4
|
||||
proc shmem_open stdcall name:dword, size:dword, access:dword
|
||||
locals
|
||||
action dd ?
|
||||
owner_access dd ?
|
||||
mapped dd ?
|
||||
endl
|
||||
locals
|
||||
action dd ?
|
||||
owner_access dd ?
|
||||
mapped dd ?
|
||||
endl
|
||||
|
||||
push ebx
|
||||
push esi
|
||||
|
@ -1,23 +1,23 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
IRQ_RESERVED equ 24
|
||||
|
||||
IRQ_POOL_SIZE equ 48
|
||||
|
||||
uglobal
|
||||
|
||||
align 16
|
||||
irqh_tab rd sizeof.LHEAD * IRQ_RESERVED / 4
|
||||
|
||||
irqh_pool rd sizeof.IRQH * IRQ_POOL_SIZE /4
|
||||
next_irqh rd 1
|
||||
|
||||
irq_active_set rd 1
|
||||
uglobal
|
||||
|
||||
align 16
|
||||
irqh_tab rd sizeof.LHEAD * IRQ_RESERVED / 4
|
||||
|
||||
irqh_pool rd sizeof.IRQH * IRQ_POOL_SIZE /4
|
||||
next_irqh rd 1
|
||||
|
||||
irq_active_set rd 1
|
||||
irq_failed rd IRQ_RESERVED
|
||||
|
||||
endg
|
||||
@ -31,20 +31,20 @@ init_irqs:
|
||||
mov eax, edi
|
||||
stosd
|
||||
stosd
|
||||
loop @B
|
||||
|
||||
mov ecx, IRQ_POOL_SIZE-1
|
||||
mov eax, irqh_pool+sizeof.IRQH
|
||||
mov [next_irqh], irqh_pool
|
||||
@@:
|
||||
mov [eax-sizeof.IRQH], eax
|
||||
add eax, sizeof.IRQH
|
||||
loop @B
|
||||
|
||||
mov [eax-sizeof.IRQH], dword 0
|
||||
ret
|
||||
|
||||
|
||||
loop @B
|
||||
|
||||
mov ecx, IRQ_POOL_SIZE-1
|
||||
mov eax, irqh_pool+sizeof.IRQH
|
||||
mov [next_irqh], irqh_pool
|
||||
@@:
|
||||
mov [eax-sizeof.IRQH], eax
|
||||
add eax, sizeof.IRQH
|
||||
loop @B
|
||||
|
||||
mov [eax-sizeof.IRQH], dword 0
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
proc attach_int_handler stdcall, irq:dword, handler:dword, user_data:dword
|
||||
locals
|
||||
|
@ -338,15 +338,15 @@ free:
|
||||
|
||||
mov [esi+edi], esi
|
||||
|
||||
; insert_chunk(p,psize);
|
||||
|
||||
mov eax, esi
|
||||
mov ecx, edi
|
||||
call insert_chunk
|
||||
jmp .fail2
|
||||
.unl_large:
|
||||
|
||||
; unlink_large_chunk((tchunkptr)next);
|
||||
; insert_chunk(p,psize);
|
||||
|
||||
mov eax, esi
|
||||
mov ecx, edi
|
||||
call insert_chunk
|
||||
jmp .fail2
|
||||
.unl_large:
|
||||
|
||||
; unlink_large_chunk((tchunkptr)next);
|
||||
|
||||
mov edx, ebx
|
||||
call unlink_large_chunk
|
||||
@ -360,15 +360,15 @@ free:
|
||||
|
||||
mov [esi+edi], esi
|
||||
|
||||
; insert_chunk(p,psize);
|
||||
|
||||
mov eax, esi
|
||||
mov ecx, edi
|
||||
call insert_chunk
|
||||
jmp .fail2
|
||||
.fix_next:
|
||||
|
||||
; (p+psize)->prev_foot = psize;
|
||||
; insert_chunk(p,psize);
|
||||
|
||||
mov eax, esi
|
||||
mov ecx, edi
|
||||
call insert_chunk
|
||||
jmp .fail2
|
||||
.fix_next:
|
||||
|
||||
; (p+psize)->prev_foot = psize;
|
||||
; next->head &= ~PINUSE_BIT;
|
||||
; p->head = psize|PINUSE_BIT;
|
||||
|
||||
@ -381,15 +381,15 @@ free:
|
||||
; (p+psize)->prev_foot = psize;
|
||||
|
||||
mov [esi+edi], esi
|
||||
; insert_chunk(p,psize);
|
||||
|
||||
mov eax, esi
|
||||
mov ecx, edi
|
||||
call insert_chunk
|
||||
jmp .fail2
|
||||
|
||||
; param
|
||||
; ecx = chunk
|
||||
; insert_chunk(p,psize);
|
||||
|
||||
mov eax, esi
|
||||
mov ecx, edi
|
||||
call insert_chunk
|
||||
jmp .fail2
|
||||
|
||||
; param
|
||||
; ecx = chunk
|
||||
; eax = size
|
||||
|
||||
insert_chunk:
|
||||
@ -412,17 +412,17 @@ insert_chunk:
|
||||
mov edx, [eax+8] ;F = B->fd
|
||||
mov [eax+8], esi ;B->fd = P
|
||||
mov [edx+12], esi ;F->bk = P
|
||||
mov [esi+8], edx ;P->fd = F
|
||||
mov [esi+12], eax ;P->bk = B
|
||||
pop esi
|
||||
ret
|
||||
.large:
|
||||
mov ebx, eax
|
||||
call insert_large_chunk
|
||||
pop esi
|
||||
ret
|
||||
|
||||
|
||||
mov [esi+8], edx ;P->fd = F
|
||||
mov [esi+12], eax ;P->bk = B
|
||||
pop esi
|
||||
ret
|
||||
.large:
|
||||
mov ebx, eax
|
||||
call insert_large_chunk
|
||||
pop esi
|
||||
ret
|
||||
|
||||
|
||||
; param
|
||||
; esi= chunk
|
||||
; ebx= size
|
||||
|
@ -439,89 +439,89 @@ proc init_LFB
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
proc new_mem_resize stdcall, new_size:dword
|
||||
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
|
||||
mov edx, [current_slot]
|
||||
cmp [edx+APPDATA.heap_base], 0
|
||||
jne .exit
|
||||
|
||||
mov edi, [new_size]
|
||||
add edi, 4095
|
||||
and edi, not 4095
|
||||
mov [new_size], edi
|
||||
|
||||
mov esi, [edx+APPDATA.mem_size]
|
||||
add esi, 4095
|
||||
and esi, not 4095
|
||||
|
||||
cmp edi, esi
|
||||
ja .expand
|
||||
je .exit
|
||||
|
||||
mov ebx, edi
|
||||
shr edi, 12
|
||||
shr esi, 12
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_lock
|
||||
@@:
|
||||
mov eax, [app_page_tabs+edi*4]
|
||||
test eax, 1
|
||||
jz .next
|
||||
|
||||
mov dword [app_page_tabs+edi*4], 0
|
||||
invlpg [ebx]
|
||||
call free_page
|
||||
|
||||
.next:
|
||||
inc edi
|
||||
add ebx, 0x1000
|
||||
cmp edi, esi
|
||||
jb @B
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
.update_size:
|
||||
mov edx, [current_slot]
|
||||
mov ebx, [new_size]
|
||||
call update_mem_size
|
||||
.exit:
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.expand:
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_lock
|
||||
|
||||
xchg esi, edi
|
||||
|
||||
push esi ;new size
|
||||
push edi ;old size
|
||||
|
||||
add edi, 0x3FFFFF
|
||||
and edi, not(0x3FFFFF)
|
||||
add esi, 0x3FFFFF
|
||||
and esi, not(0x3FFFFF)
|
||||
|
||||
cmp edi, esi
|
||||
jae .grow
|
||||
@@:
|
||||
call alloc_page
|
||||
test eax, eax
|
||||
jz .exit_fail
|
||||
|
||||
stdcall map_page_table, edi, eax
|
||||
|
||||
align 4
|
||||
proc new_mem_resize stdcall, new_size:dword
|
||||
|
||||
push ebx
|
||||
push esi
|
||||
push edi
|
||||
|
||||
mov edx, [current_slot]
|
||||
cmp [edx+APPDATA.heap_base], 0
|
||||
jne .exit
|
||||
|
||||
mov edi, [new_size]
|
||||
add edi, 4095
|
||||
and edi, not 4095
|
||||
mov [new_size], edi
|
||||
|
||||
mov esi, [edx+APPDATA.mem_size]
|
||||
add esi, 4095
|
||||
and esi, not 4095
|
||||
|
||||
cmp edi, esi
|
||||
ja .expand
|
||||
je .exit
|
||||
|
||||
mov ebx, edi
|
||||
shr edi, 12
|
||||
shr esi, 12
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_lock
|
||||
@@:
|
||||
mov eax, [app_page_tabs+edi*4]
|
||||
test eax, 1
|
||||
jz .next
|
||||
|
||||
mov dword [app_page_tabs+edi*4], 0
|
||||
invlpg [ebx]
|
||||
call free_page
|
||||
|
||||
.next:
|
||||
inc edi
|
||||
add ebx, 0x1000
|
||||
cmp edi, esi
|
||||
jb @B
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
.update_size:
|
||||
mov edx, [current_slot]
|
||||
mov ebx, [new_size]
|
||||
call update_mem_size
|
||||
.exit:
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
ret
|
||||
|
||||
.expand:
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_lock
|
||||
|
||||
xchg esi, edi
|
||||
|
||||
push esi ;new size
|
||||
push edi ;old size
|
||||
|
||||
add edi, 0x3FFFFF
|
||||
and edi, not(0x3FFFFF)
|
||||
add esi, 0x3FFFFF
|
||||
and esi, not(0x3FFFFF)
|
||||
|
||||
cmp edi, esi
|
||||
jae .grow
|
||||
@@:
|
||||
call alloc_page
|
||||
test eax, eax
|
||||
jz .exit_fail
|
||||
|
||||
stdcall map_page_table, edi, eax
|
||||
|
||||
push edi
|
||||
shr edi, 10
|
||||
add edi, page_tabs
|
||||
@ -532,44 +532,44 @@ proc new_mem_resize stdcall, new_size:dword
|
||||
pop edi
|
||||
|
||||
add edi, 0x00400000
|
||||
cmp edi, esi
|
||||
jb @B
|
||||
.grow:
|
||||
pop edi ;old size
|
||||
pop ecx ;new size
|
||||
|
||||
shr edi, 10
|
||||
shr ecx, 10
|
||||
sub ecx, edi
|
||||
shr ecx, 2 ;pages count
|
||||
mov eax, 2
|
||||
|
||||
add edi, app_page_tabs
|
||||
rep stosd
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
jmp .update_size
|
||||
|
||||
.exit_fail:
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
add esp, 8
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
inc eax
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
align 4
|
||||
update_mem_size:
|
||||
; in: edx = slot base
|
||||
; ebx = new memory size
|
||||
cmp edi, esi
|
||||
jb @B
|
||||
.grow:
|
||||
pop edi ;old size
|
||||
pop ecx ;new size
|
||||
|
||||
shr edi, 10
|
||||
shr ecx, 10
|
||||
sub ecx, edi
|
||||
shr ecx, 2 ;pages count
|
||||
mov eax, 2
|
||||
|
||||
add edi, app_page_tabs
|
||||
rep stosd
|
||||
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
jmp .update_size
|
||||
|
||||
.exit_fail:
|
||||
mov ecx, pg_data.mutex
|
||||
call mutex_unlock
|
||||
|
||||
add esp, 8
|
||||
pop edi
|
||||
pop esi
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
inc eax
|
||||
ret
|
||||
endp
|
||||
|
||||
|
||||
align 4
|
||||
update_mem_size:
|
||||
; in: edx = slot base
|
||||
; ebx = new memory size
|
||||
; destroys eax,ecx,edx
|
||||
|
||||
mov [APPDATA.mem_size+edx], ebx
|
||||
@ -603,18 +603,18 @@ update_mem_size:
|
||||
;
|
||||
; retval
|
||||
; eax= phisical page address
|
||||
|
||||
align 4
|
||||
get_pg_addr:
|
||||
sub eax, OS_BASE
|
||||
cmp eax, 0x400000
|
||||
jb @f
|
||||
shr eax, 12
|
||||
mov eax, [page_tabs+(eax+(OS_BASE shr 12))*4]
|
||||
@@:
|
||||
and eax, 0xFFFFF000
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
get_pg_addr:
|
||||
sub eax, OS_BASE
|
||||
cmp eax, 0x400000
|
||||
jb @f
|
||||
shr eax, 12
|
||||
mov eax, [page_tabs+(eax+(OS_BASE shr 12))*4]
|
||||
@@:
|
||||
and eax, 0xFFFFF000
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
; Now it is called from core/sys32::exc_c (see stack frame there)
|
||||
@ -1252,13 +1252,13 @@ f68:
|
||||
mov [esp+32], eax
|
||||
ret
|
||||
.21:
|
||||
cmp ecx, OS_BASE
|
||||
jae .fail
|
||||
|
||||
cmp edx, OS_BASE
|
||||
jae .fail
|
||||
|
||||
mov edi, edx
|
||||
cmp ecx, OS_BASE
|
||||
jae .fail
|
||||
|
||||
cmp edx, OS_BASE
|
||||
jae .fail
|
||||
|
||||
mov edi, edx
|
||||
stdcall load_PE, ecx
|
||||
mov esi, eax
|
||||
test eax, eax
|
||||
|
@ -297,13 +297,13 @@ __exports:
|
||||
free_page, 'FreePage', \ ; eax
|
||||
kernel_alloc, 'KernelAlloc', \ ; stdcall
|
||||
kernel_free, 'KernelFree', \ ; stdcall
|
||||
malloc, 'Kmalloc', \
|
||||
free, 'Kfree', \
|
||||
map_io_mem, 'MapIoMem', \ ; stdcall
|
||||
map_page, 'MapPage', \ ; stdcall
|
||||
get_pg_addr, 'GetPgAddr', \ ; eax
|
||||
\
|
||||
mutex_init, 'MutexInit', \ ; gcc fastcall
|
||||
malloc, 'Kmalloc', \
|
||||
free, 'Kfree', \
|
||||
map_io_mem, 'MapIoMem', \ ; stdcall
|
||||
map_page, 'MapPage', \ ; stdcall
|
||||
get_pg_addr, 'GetPgAddr', \ ; eax
|
||||
\
|
||||
mutex_init, 'MutexInit', \ ; gcc fastcall
|
||||
mutex_lock, 'MutexLock', \ ; gcc fastcall
|
||||
mutex_unlock, 'MutexUnlock', \ ; gcc fastcall
|
||||
\
|
||||
|
4
kernel/branches/net/core/sys32-sp.inc
Normal file
4
kernel/branches/net/core/sys32-sp.inc
Normal file
@ -0,0 +1,4 @@
|
||||
; <EFBFBD>ste archivo debe ser editado con codificaci¢n CP866
|
||||
|
||||
msg_sel_ker db "n£cleo", 0
|
||||
msg_sel_app db "aplicaci¢n", 0
|
@ -75,8 +75,12 @@ iglobal
|
||||
msg_exc_d db "General protection fault", 0
|
||||
msg_exc_e db "Page fault", 0
|
||||
|
||||
msg_sel_ker db "kernel", 0
|
||||
msg_sel_app db "application", 0
|
||||
if lang eq sp
|
||||
include 'core/sys32-sp.inc'
|
||||
else
|
||||
msg_sel_ker db "kernel", 0
|
||||
msg_sel_app db "application", 0
|
||||
end if
|
||||
|
||||
endg
|
||||
|
||||
@ -219,7 +223,11 @@ show_error_parameters:
|
||||
pop ebx
|
||||
.no_ud:
|
||||
mov edx, [TASK_BASE];not scratched below
|
||||
DEBUGF 1, "K : Process - forced terminate PID: %x\n", [edx+TASKDATA.pid]
|
||||
if lang eq sp
|
||||
DEBUGF 1, "K : Proceso - terminado forzado PID: %x [%s]\n", [edx+TASKDATA.pid], [current_slot]
|
||||
else
|
||||
DEBUGF 1, "K : Process - forced terminate PID: %x [%s]\n", [edx+TASKDATA.pid], [current_slot]
|
||||
end if
|
||||
cmp bl, 0x08
|
||||
jb .l0
|
||||
cmp bl, 0x0e
|
||||
@ -428,23 +436,23 @@ term9:
|
||||
mov [eax+8], ecx
|
||||
mov [eax+12], ecx
|
||||
.cont:
|
||||
add eax, 16
|
||||
cmp eax, hotkey_list+256*16
|
||||
jb .loop
|
||||
; get process PID
|
||||
mov eax, esi
|
||||
shl eax, 5
|
||||
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
|
||||
; compare current lock input with process PID
|
||||
cmp eax, [PID_lock_input]
|
||||
jne @f
|
||||
|
||||
xor eax, eax
|
||||
mov [PID_lock_input], eax
|
||||
@@:
|
||||
; remove hotkeys in buffer
|
||||
mov eax, hotkey_buffer
|
||||
.loop2:
|
||||
add eax, 16
|
||||
cmp eax, hotkey_list+256*16
|
||||
jb .loop
|
||||
; get process PID
|
||||
mov eax, esi
|
||||
shl eax, 5
|
||||
mov eax, [eax+CURRENT_TASK+TASKDATA.pid]
|
||||
; compare current lock input with process PID
|
||||
cmp eax, [PID_lock_input]
|
||||
jne @f
|
||||
|
||||
xor eax, eax
|
||||
mov [PID_lock_input], eax
|
||||
@@:
|
||||
; remove hotkeys in buffer
|
||||
mov eax, hotkey_buffer
|
||||
.loop2:
|
||||
cmp [eax], esi
|
||||
jnz .cont2
|
||||
and dword [eax+4], 0
|
||||
@ -691,25 +699,100 @@ term9:
|
||||
;mov esi,process_terminated
|
||||
;call sys_msg_board_str
|
||||
add esp, 4
|
||||
ret
|
||||
restore .slot
|
||||
|
||||
;iglobal
|
||||
;if lang eq ru
|
||||
; boot_sched_1 db '‘®§¤ ¨¥ GDT TSS 㪠§ ⥫ï',0
|
||||
; boot_sched_2 db '‘®§¤ ¨¥ IDT â ¡«¨æë',0
|
||||
;else
|
||||
; boot_sched_1 db 'Building gdt tss pointer',0
|
||||
; boot_sched_2 db 'Building IDT table',0
|
||||
;end if
|
||||
;endg
|
||||
|
||||
|
||||
;build_scheduler:
|
||||
; mov esi, boot_sched_1
|
||||
; call boot_log
|
||||
; call build_process_gdt_tss_pointer
|
||||
|
||||
; mov esi,boot_sched_2
|
||||
; call boot_log
|
||||
; ret
|
||||
ret
|
||||
restore .slot
|
||||
|
||||
;iglobal
|
||||
;if lang eq ru
|
||||
; boot_sched_1 db '‘®§¤ ¨¥ GDT TSS 㪠§ ⥫ï',0
|
||||
; boot_sched_2 db '‘®§¤ ¨¥ IDT â ¡«¨æë',0
|
||||
;else
|
||||
; boot_sched_1 db 'Building gdt tss pointer',0
|
||||
; boot_sched_2 db 'Building IDT table',0
|
||||
;end if
|
||||
;endg
|
||||
|
||||
|
||||
;build_scheduler:
|
||||
; mov esi, boot_sched_1
|
||||
; call boot_log
|
||||
; call build_process_gdt_tss_pointer
|
||||
|
||||
; mov esi,boot_sched_2
|
||||
; call boot_log
|
||||
; ret
|
||||
|
||||
; Three following procedures are used to guarantee that
|
||||
; some part of kernel code will not be terminated from outside
|
||||
; while it is running.
|
||||
; Note: they do not protect a thread from terminating due to errors inside
|
||||
; the thread; accessing a nonexisting memory would still terminate it.
|
||||
|
||||
; First two procedures must be used in pair by thread-to-be-protected
|
||||
; to signal the beginning and the end of an important part.
|
||||
; It is OK to have nested areas.
|
||||
|
||||
; The last procedure must be used by outside wanna-be-terminators;
|
||||
; if it is safe to terminate the given thread immediately, it returns eax=1;
|
||||
; otherwise, it returns eax=0 and notifies the target thread that it should
|
||||
; terminate itself when leaving a critical area (the last critical area if
|
||||
; they are nested).
|
||||
|
||||
; Implementation. Those procedures use one dword in APPDATA for the thread,
|
||||
; APPDATA.terminate_protection.
|
||||
; * The upper bit is 1 during normal operations and 0 when terminate is requested.
|
||||
; * Other bits form a number = depth of critical regions,
|
||||
; plus 1 if the upper bit is 1.
|
||||
; * When this dword goes to zero, the thread should be destructed,
|
||||
; and the procedure in which it happened becomes responsible for destruction.
|
||||
|
||||
; Enter critical area. Called by thread which wants to be protected.
|
||||
proc protect_from_terminate
|
||||
mov edx, [current_slot]
|
||||
; Atomically increment depth of critical areas and get the old value.
|
||||
mov eax, 1
|
||||
lock xadd [edx+APPDATA.terminate_protection], eax
|
||||
; If the old value was zero, somebody has started to terminate us,
|
||||
; so we are destructing and cannot do anything protected.
|
||||
; Otherwise, return to the caller.
|
||||
test eax, eax
|
||||
jz @f
|
||||
ret
|
||||
@@:
|
||||
; Wait for somebody to finish us.
|
||||
call change_task
|
||||
jmp @b
|
||||
endp
|
||||
|
||||
; Leave critical area. Called by thread which wants to be protected.
|
||||
proc unprotect_from_terminate
|
||||
mov edx, [current_slot]
|
||||
; Atomically decrement depth of critical areas.
|
||||
lock dec [edx+APPDATA.terminate_protection]
|
||||
; If the result of decrement is zero, somebody has requested termination,
|
||||
; but at that moment we were inside a critical area; terminate now.
|
||||
jz sys_end
|
||||
; Otherwise, return to the caller.
|
||||
ret
|
||||
endp
|
||||
|
||||
; Request termination of thread identified by edx = SLOT_BASE + slot*256.
|
||||
; Called by anyone.
|
||||
proc request_terminate
|
||||
xor eax, eax ; set return value
|
||||
; Atomically clear the upper bit. If it was already zero, then
|
||||
; somebody has requested termination before us, so just exit.
|
||||
lock btr [edx+APPDATA.terminate_protection], 31
|
||||
jnc .unsafe
|
||||
; Atomically decrement depth of critical areas.
|
||||
lock dec [edx+APPDATA.terminate_protection]
|
||||
; If the result of decrement is nonzero, the target thread is inside a
|
||||
; critical area; leave termination to leaving that area.
|
||||
jnz .unsafe
|
||||
; Otherwise, it is safe to kill the target now and the caller is responsible
|
||||
; for this. Return eax=1.
|
||||
inc eax
|
||||
.unsafe:
|
||||
ret
|
||||
endp
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision $
|
||||
$Revision$
|
||||
|
||||
; Old style system call converter
|
||||
align 16
|
||||
@ -38,9 +38,13 @@ sysenter_entry:
|
||||
pushad
|
||||
cld
|
||||
|
||||
movzx eax, al
|
||||
call protect_from_terminate
|
||||
|
||||
movzx eax, byte [esp+28]
|
||||
mov edx, dword [esp+20]
|
||||
call dword [servetable2 + eax * 4]
|
||||
|
||||
call unprotect_from_terminate
|
||||
popad
|
||||
;------------------
|
||||
xchg ecx, [ss:esp] ; â âåðøèí ñòåêà - app ecx, ecx - app esp + 4
|
||||
@ -62,8 +66,11 @@ align 16
|
||||
i40:
|
||||
pushad
|
||||
cld
|
||||
movzx eax, al
|
||||
call protect_from_terminate
|
||||
movzx eax, byte [esp+28]
|
||||
mov edx, dword [esp+20]
|
||||
call dword [servetable2 + eax * 4]
|
||||
call unprotect_from_terminate
|
||||
popad
|
||||
iretd
|
||||
|
||||
@ -85,10 +92,13 @@ syscall_entry:
|
||||
;------------------
|
||||
pushad
|
||||
cld
|
||||
call protect_from_terminate
|
||||
|
||||
movzx eax, al
|
||||
movzx eax, byte [esp+28]
|
||||
mov edx, dword [esp+20]
|
||||
call dword [servetable2 + eax * 4]
|
||||
|
||||
call unprotect_from_terminate
|
||||
popad
|
||||
;------------------
|
||||
mov ecx, [ss:esp+4]
|
||||
@ -125,7 +135,7 @@ iglobal
|
||||
dd sys_getkey ; 2-GetKey
|
||||
dd sys_clock ; 3-GetTime
|
||||
dd syscall_writetext ; 4-WriteText
|
||||
dd delay_hs ; 5-DelayHs
|
||||
dd delay_hs_unprotected ; 5-DelayHs
|
||||
dd syscall_openramdiskfile ; 6-OpenRamdiskFile
|
||||
dd syscall_putimage ; 7-PutImage
|
||||
dd syscall_button ; 8-DefineButton
|
||||
|
@ -5,7 +5,7 @@
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision $
|
||||
$Revision$
|
||||
|
||||
|
||||
GREEDY_KERNEL equ 0
|
||||
@ -307,7 +307,6 @@ end if
|
||||
.failed:
|
||||
mov eax, [save_cr3]
|
||||
call set_cr3
|
||||
|
||||
.err:
|
||||
.err_hdr:
|
||||
stdcall kernel_free, [file_base]
|
||||
@ -1076,6 +1075,7 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
||||
mov [eax+SLOT_BASE+APPDATA.fpu_state], edi
|
||||
mov [eax+SLOT_BASE+APPDATA.exc_handler], 0
|
||||
mov [eax+SLOT_BASE+APPDATA.except_mask], 0
|
||||
mov [eax+SLOT_BASE+APPDATA.terminate_protection], 80000001h
|
||||
|
||||
;set default io permission map
|
||||
mov ecx, [SLOT_BASE+256+APPDATA.io_map]
|
||||
@ -1200,6 +1200,14 @@ proc set_app_params stdcall,slot:dword, params:dword,\
|
||||
mov eax, [esi+0x08] ;app_eip
|
||||
mov [ebx+REG_EIP], eax;app_entry
|
||||
mov [ebx+REG_CS], dword app_code
|
||||
mov eax, [CURRENT_TASK]
|
||||
shl eax, 8 ; created by kernel?
|
||||
cmp [SLOT_BASE+eax+APPDATA.dir_table], sys_pgdir - OS_BASE
|
||||
jnz @f
|
||||
cmp [app_path], 0 ; it is a thread?
|
||||
jnz @f
|
||||
mov [ebx+REG_CS], dword os_code ; kernel thread
|
||||
@@:
|
||||
mov [ebx+REG_EFLAGS], dword EFL_IOPL1+EFL_IF
|
||||
|
||||
mov eax, [esi+0x0C] ;app_esp
|
||||
|
@ -1,13 +1,13 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Tests of malloc()/free() from the kernel heap.
|
||||
; This file is not included in the kernel, it is just test application.
|
||||
use32
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Tests of malloc()/free() from the kernel heap.
|
||||
; This file is not included in the kernel, it is just test application.
|
||||
use32
|
||||
db 'MENUET01'
|
||||
dd 1, start, i_end, mem, mem, 0, 0
|
||||
|
||||
@ -47,18 +47,18 @@ run_test1:
|
||||
ret
|
||||
|
||||
run_test2:
|
||||
ret
|
||||
|
||||
run_test3:
|
||||
; 1024 times run random operation.
|
||||
; Randomly select malloc(random size from 1 to 1023)
|
||||
; or free(random of previously allocated areas)
|
||||
mov edi, 0x12345678
|
||||
xor esi, esi ; 0 areas allocated
|
||||
mov ebx, 1024
|
||||
.loop:
|
||||
imul edi, 1103515245
|
||||
add edi, 12345
|
||||
ret
|
||||
|
||||
run_test3:
|
||||
; 1024 times run random operation.
|
||||
; Randomly select malloc(random size from 1 to 1023)
|
||||
; or free(random of previously allocated areas)
|
||||
mov edi, 0x12345678
|
||||
xor esi, esi ; 0 areas allocated
|
||||
mov ebx, 1024
|
||||
.loop:
|
||||
imul edi, 1103515245
|
||||
add edi, 12345
|
||||
mov eax, edi
|
||||
shr eax, 16
|
||||
test ebx, 64
|
||||
@ -75,17 +75,17 @@ run_test3:
|
||||
and eax, 1023
|
||||
jz .loop
|
||||
push ebx
|
||||
push eax
|
||||
; mov ecx, [saved_state_num]
|
||||
; mov [saved_state+ecx*8], eax
|
||||
push edi
|
||||
call malloc_with_test
|
||||
pop ecx
|
||||
cmp ecx, edi
|
||||
jnz edi_destroyed
|
||||
; mov ecx, [saved_state_num]
|
||||
; mov [saved_state+ecx*8+4], eax
|
||||
; inc [saved_state_num]
|
||||
push eax
|
||||
; mov ecx, [saved_state_num]
|
||||
; mov [saved_state+ecx*8], eax
|
||||
push edi
|
||||
call malloc_with_test
|
||||
pop ecx
|
||||
cmp ecx, edi
|
||||
jnz edi_destroyed
|
||||
; mov ecx, [saved_state_num]
|
||||
; mov [saved_state+ecx*8+4], eax
|
||||
; inc [saved_state_num]
|
||||
pop ecx
|
||||
pop ebx
|
||||
inc esi
|
||||
@ -114,17 +114,17 @@ run_test3:
|
||||
mov edi, eax
|
||||
mov al, [edi]
|
||||
repz scasb
|
||||
jnz memory_destroyed
|
||||
pop eax edi
|
||||
push ebx edx
|
||||
push edi
|
||||
call free
|
||||
pop ecx
|
||||
cmp ecx, edi
|
||||
jnz edi_destroyed
|
||||
pop edx ebx
|
||||
dec esi
|
||||
pop eax ecx
|
||||
jnz memory_destroyed
|
||||
pop eax edi
|
||||
push ebx edx
|
||||
push edi
|
||||
call free
|
||||
pop ecx
|
||||
cmp ecx, edi
|
||||
jnz edi_destroyed
|
||||
pop edx ebx
|
||||
dec esi
|
||||
pop eax ecx
|
||||
push edi
|
||||
lea edi, [esp+4]
|
||||
@@:
|
||||
@ -155,21 +155,21 @@ malloc_with_test:
|
||||
jz generic_malloc_fail
|
||||
call check_mutex
|
||||
call check_range
|
||||
ret
|
||||
|
||||
; Stubs for kernel procedures used by heap code
|
||||
mutex_init:
|
||||
and dword [ecx], 0
|
||||
ret
|
||||
mutex_lock:
|
||||
inc dword [ecx]
|
||||
ret
|
||||
mutex_unlock:
|
||||
dec dword [ecx]
|
||||
ret
|
||||
|
||||
kernel_alloc:
|
||||
cmp dword [esp+4], bufsize
|
||||
ret
|
||||
|
||||
; Stubs for kernel procedures used by heap code
|
||||
mutex_init:
|
||||
and dword [ecx], 0
|
||||
ret
|
||||
mutex_lock:
|
||||
inc dword [ecx]
|
||||
ret
|
||||
mutex_unlock:
|
||||
dec dword [ecx]
|
||||
ret
|
||||
|
||||
kernel_alloc:
|
||||
cmp dword [esp+4], bufsize
|
||||
jnz error1
|
||||
mov eax, buffer
|
||||
ret 4
|
||||
@ -185,13 +185,13 @@ error1:
|
||||
|
||||
generic_malloc_fail:
|
||||
mov eax, 2
|
||||
jmp error_with_code
|
||||
|
||||
check_mutex:
|
||||
cmp dword [mst.mutex], 0
|
||||
jnz @f
|
||||
ret
|
||||
@@:
|
||||
jmp error_with_code
|
||||
|
||||
check_mutex:
|
||||
cmp dword [mst.mutex], 0
|
||||
jnz @f
|
||||
ret
|
||||
@@:
|
||||
mov eax, 3
|
||||
jmp error_with_code
|
||||
|
||||
@ -206,16 +206,16 @@ check_range:
|
||||
jmp error_with_code
|
||||
|
||||
memory_destroyed:
|
||||
mov eax, 5
|
||||
jmp error_with_code
|
||||
|
||||
edi_destroyed:
|
||||
mov eax, 6
|
||||
jmp error_with_code
|
||||
|
||||
error_with_code:
|
||||
mov edx, saved_state_num
|
||||
; eax = error code
|
||||
mov eax, 5
|
||||
jmp error_with_code
|
||||
|
||||
edi_destroyed:
|
||||
mov eax, 6
|
||||
jmp error_with_code
|
||||
|
||||
error_with_code:
|
||||
mov edx, saved_state_num
|
||||
; eax = error code
|
||||
; 1 signals error in testing code (wrong bufsize)
|
||||
; 2 = malloc() returned NULL
|
||||
; 3 = mutex not released
|
||||
@ -223,13 +223,13 @@ error_with_code:
|
||||
; 5 = memory destroyed by malloc() or free()
|
||||
int3 ; simplest way to report error
|
||||
jmp $-1 ; just in case
|
||||
|
||||
; Include main heap code
|
||||
include '../proc32.inc'
|
||||
include '../struct.inc'
|
||||
include '../const.inc'
|
||||
include 'malloc.inc'
|
||||
|
||||
|
||||
; Include main heap code
|
||||
include '../proc32.inc'
|
||||
include '../struct.inc'
|
||||
include '../const.inc'
|
||||
include 'malloc.inc'
|
||||
|
||||
i_end:
|
||||
|
||||
align 4
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision: 2381 $
|
||||
|
||||
|
@ -46,29 +46,29 @@ keymap_alt:
|
||||
db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
db 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
|
||||
|
||||
|
||||
if lang eq ru
|
||||
boot_initirq db 'ˆ¨æ¨ «¨§ æ¨ï IRQ',0
|
||||
boot_picinit db 'ˆ¨æ¨ «¨§ æ¨ï PIC',0
|
||||
boot_v86machine db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬ë V86 ¬ è¨ë',0
|
||||
boot_inittimer db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬®£® â ©¬¥à (IRQ0)',0
|
||||
boot_initapic db '<27>®¯ë⪠¨¨æ¨ «¨§ 樨 APIC',0
|
||||
boot_enableirq db '‚ª«îç¨âì ¯à¥àë¢ ¨ï 2, 6, 13, 14, 15',0
|
||||
boot_enablint_ide db '<27> §à¥è¥¨¥ ¯à¥àë¢ ¨© ¢ ª®â஫«¥à¥ IDE',0
|
||||
boot_detectfloppy db '<27>®¨áª floppy ¤¨áª®¢®¤®¢',0
|
||||
boot_detecthdcd db '<27>®¨áª ¦¥áâª¨å ¤¨áª®¢ ¨ ATAPI ¯à¨¢®¤®¢',0
|
||||
boot_getcache db '<27>®«ã票¥ ¯ ¬ï⨠¤«ï ªíè ',0
|
||||
boot_detectpart db '<27>®¨áª à §¤¥«®¢ ¤¨áª®¢ëå ãáâனá⢠å',0
|
||||
boot_init_sys db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬®£® ª â «®£ /sys',0
|
||||
boot_loadlibs db '‡ £à㧪 ¡¨¡«¨®â¥ª (.obj)',0
|
||||
boot_memdetect db 'Š®«¨ç¥á⢮ ®¯¥à ⨢®© ¯ ¬ïâ¨',' ',' Œ¡',0
|
||||
boot_tss db '“áâ ®¢ª TSSs',0
|
||||
boot_cpuid db '—⥨¥ CPUIDs',0
|
||||
; boot_devices db '<27>®¨áª ãáâனáâ¢',0
|
||||
boot_timer db '“áâ ®¢ª â ©¬¥à ',0
|
||||
boot_irqs db '<27>¥à¥®¯à¥¤¥«¥¨¥ IRQ',0
|
||||
boot_setmouse db '“áâ ®¢ª ¬ëè¨',0
|
||||
|
||||
|
||||
if lang eq ru
|
||||
boot_initirq db 'ˆ¨æ¨ «¨§ æ¨ï IRQ',0
|
||||
boot_picinit db 'ˆ¨æ¨ «¨§ æ¨ï PIC',0
|
||||
boot_v86machine db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬ë V86 ¬ è¨ë',0
|
||||
boot_inittimer db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬®£® â ©¬¥à (IRQ0)',0
|
||||
boot_initapic db '<27>®¯ë⪠¨¨æ¨ «¨§ 樨 APIC',0
|
||||
boot_enableirq db '‚ª«îç¨âì ¯à¥àë¢ ¨ï 2, 6, 13, 14, 15',0
|
||||
boot_enablint_ide db '<27> §à¥è¥¨¥ ¯à¥àë¢ ¨© ¢ ª®â஫«¥à¥ IDE',0
|
||||
boot_detectfloppy db '<27>®¨áª floppy ¤¨áª®¢®¤®¢',0
|
||||
boot_detecthdcd db '<27>®¨áª ¦¥áâª¨å ¤¨áª®¢ ¨ ATAPI ¯à¨¢®¤®¢',0
|
||||
boot_getcache db '<27>®«ã票¥ ¯ ¬ï⨠¤«ï ªíè ',0
|
||||
boot_detectpart db '<27>®¨áª à §¤¥«®¢ ¤¨áª®¢ëå ãáâனá⢠å',0
|
||||
boot_init_sys db 'ˆ¨æ¨ «¨§ æ¨ï á¨á⥬®£® ª â «®£ /sys',0
|
||||
boot_loadlibs db '‡ £à㧪 ¡¨¡«¨®â¥ª (.obj)',0
|
||||
boot_memdetect db 'Š®«¨ç¥á⢮ ®¯¥à ⨢®© ¯ ¬ïâ¨',' ',' Œ¡',0
|
||||
boot_tss db '“áâ ®¢ª TSSs',0
|
||||
boot_cpuid db '—⥨¥ CPUIDs',0
|
||||
; boot_devices db '<27>®¨áª ãáâனáâ¢',0
|
||||
boot_timer db '“áâ ®¢ª â ©¬¥à ',0
|
||||
boot_irqs db '<27>¥à¥®¯à¥¤¥«¥¨¥ IRQ',0
|
||||
boot_setmouse db '“áâ ®¢ª ¬ëè¨',0
|
||||
boot_windefs db '“áâ ®¢ª áâ஥ª ®ª® ¯® 㬮«ç ¨î',0
|
||||
boot_bgr db '“áâ ®¢ª ä® ',0
|
||||
boot_resirqports db '<27>¥§¥à¢¨à®¢ ¨¥ IRQ ¨ ¯®à⮢',0
|
||||
@ -78,69 +78,73 @@ if lang eq ru
|
||||
boot_tsc db '—⥨¥ TSC',0
|
||||
boot_cpufreq db '— áâ®â ¯à®æ¥áá®à ',' ',' Œƒæ',0
|
||||
boot_pal_ega db '“áâ ®¢ª EGA/CGA 320x200 ¯ «¨âàë',0
|
||||
boot_pal_vga db '“áâ ®¢ª VGA 640x480 ¯ «¨âàë',0
|
||||
boot_failed db '‡ £à㧪 ¯¥à¢®£® ¯à¨«®¦¥¨ï ¥ 㤠« áì',0
|
||||
boot_mtrr db '“áâ ®¢ª MTRR',0
|
||||
|
||||
boot_APIC_found db 'APIC ¢ª«îç¥', 0
|
||||
boot_APIC_nfound db 'APIC ¥ ©¤¥', 0
|
||||
if preboot_blogesc
|
||||
boot_tasking db '‚ᥠ£®â®¢® ¤«ï § ¯ã᪠, ¦¬¨âॠESC ¤«ï áâ àâ ',0
|
||||
end if
|
||||
else
|
||||
boot_initirq db 'Initialize IRQ',0
|
||||
boot_picinit db 'Initialize PIC',0
|
||||
boot_v86machine db 'Initialize system V86 machine',0
|
||||
boot_inittimer db 'Initialize system timer (IRQ0)',0
|
||||
boot_initapic db 'Try to initialize APIC',0
|
||||
boot_enableirq db 'Enable interrupts 2, 6, 13, 14, 15',0
|
||||
boot_enablint_ide db 'Enable interrupts in IDE controller',0
|
||||
boot_detectfloppy db 'Search floppy drives',0
|
||||
boot_detecthdcd db 'Search hard drives and ATAPI drives',0
|
||||
boot_getcache db 'Get memory for cache',0
|
||||
boot_detectpart db 'Search partitions on disk devices',0
|
||||
boot_init_sys db 'Initialize system directory /sys',0
|
||||
boot_loadlibs db 'Loading librares (.obj)',0
|
||||
boot_memdetect db 'Determining amount of memory',0
|
||||
boot_tss db 'Setting TSSs',0
|
||||
boot_cpuid db 'Reading CPUIDs',0
|
||||
; boot_devices db 'Detecting devices',0
|
||||
boot_setmouse db 'Setting mouse',0
|
||||
boot_windefs db 'Setting window defaults',0
|
||||
boot_bgr db 'Calculating background',0
|
||||
boot_pal_vga db '“áâ ®¢ª VGA 640x480 ¯ «¨âàë',0
|
||||
boot_failed db '‡ £à㧪 ¯¥à¢®£® ¯à¨«®¦¥¨ï ¥ 㤠« áì',0
|
||||
boot_mtrr db '“áâ ®¢ª MTRR',0
|
||||
|
||||
boot_APIC_found db 'APIC ¢ª«îç¥', 0
|
||||
boot_APIC_nfound db 'APIC ¥ ©¤¥', 0
|
||||
if preboot_blogesc
|
||||
boot_tasking db '‚ᥠ£®â®¢® ¤«ï § ¯ã᪠, ¦¬¨âॠESC ¤«ï áâ àâ ',0
|
||||
end if
|
||||
else if lang eq sp
|
||||
include 'data32sp.inc'
|
||||
else
|
||||
boot_initirq db 'Initialize IRQ',0
|
||||
boot_picinit db 'Initialize PIC',0
|
||||
boot_v86machine db 'Initialize system V86 machine',0
|
||||
boot_inittimer db 'Initialize system timer (IRQ0)',0
|
||||
boot_initapic db 'Try to initialize APIC',0
|
||||
boot_enableirq db 'Enable interrupts 2, 6, 13, 14, 15',0
|
||||
boot_enablint_ide db 'Enable interrupts in IDE controller',0
|
||||
boot_detectfloppy db 'Search floppy drives',0
|
||||
boot_detecthdcd db 'Search hard drives and ATAPI drives',0
|
||||
boot_getcache db 'Get memory for cache',0
|
||||
boot_detectpart db 'Search partitions on disk devices',0
|
||||
boot_init_sys db 'Initialize system directory /sys',0
|
||||
boot_loadlibs db 'Loading librares (.obj)',0
|
||||
boot_memdetect db 'Determining amount of memory',0
|
||||
boot_tss db 'Setting TSSs',0
|
||||
boot_cpuid db 'Reading CPUIDs',0
|
||||
; boot_devices db 'Detecting devices',0
|
||||
boot_setmouse db 'Setting mouse',0
|
||||
boot_windefs db 'Setting window defaults',0
|
||||
boot_bgr db 'Calculating background',0
|
||||
boot_resirqports db 'Reserving IRQs & ports',0
|
||||
boot_setostask db 'Setting OS task',0
|
||||
boot_allirqs db 'Unmasking IRQs',0
|
||||
boot_tsc db 'Reading TSC',0
|
||||
boot_cpufreq db 'CPU frequency is ',' ',' MHz',0
|
||||
boot_pal_ega db 'Setting EGA/CGA 320x200 palette',0
|
||||
boot_pal_vga db 'Setting VGA 640x480 palette',0
|
||||
boot_failed db 'Failed to start first app',0
|
||||
boot_mtrr db 'Setting MTRR',0
|
||||
|
||||
boot_APIC_found db 'APIC enabled', 0
|
||||
boot_APIC_nfound db 'APIC not found', 0
|
||||
if preboot_blogesc
|
||||
boot_tasking db 'All set - press ESC to start',0
|
||||
end if
|
||||
end if
|
||||
|
||||
;new_process_loading db 'K : New Process - loading',13,10,0
|
||||
;new_process_running db 'K : New Process - done',13,10,0
|
||||
start_not_enough_memory db 'K : New Process - not enough memory',13,10,0
|
||||
boot_pal_vga db 'Setting VGA 640x480 palette',0
|
||||
boot_failed db 'Failed to start first app',0
|
||||
boot_mtrr db 'Setting MTRR',0
|
||||
|
||||
boot_APIC_found db 'APIC enabled', 0
|
||||
boot_APIC_nfound db 'APIC not found', 0
|
||||
if preboot_blogesc
|
||||
boot_tasking db 'All set - press ESC to start',0
|
||||
end if
|
||||
end if
|
||||
|
||||
;new_process_loading db 'K : New Process - loading',13,10,0
|
||||
;new_process_running db 'K : New Process - done',13,10,0
|
||||
start_not_enough_memory db 'K : New Process - not enough memory',13,10,0
|
||||
|
||||
msg_unresolved db 'unresolved ',0
|
||||
msg_module db 'in module ',0
|
||||
msg_version db 'incompatible driver version',13,10,0
|
||||
msg_www db 'please visit www.kolibrios.org',13,10,0
|
||||
msg_CR db 13,10,0
|
||||
|
||||
intel_str db "GenuineIntel",0
|
||||
AMD_str db "AuthenticAMD",0
|
||||
|
||||
szHwMouse db 'ATI2D',0
|
||||
szPS2MDriver db 'PS2MOUSE',0
|
||||
;szCOM_MDriver db 'COM_MOUSE',0
|
||||
if ~ lang eq sp
|
||||
msg_version db 'incompatible driver version',13,10,0
|
||||
msg_www db 'please visit www.kolibrios.org',13,10,0
|
||||
end if
|
||||
msg_CR db 13,10,0
|
||||
|
||||
intel_str db "GenuineIntel",0
|
||||
AMD_str db "AuthenticAMD",0
|
||||
|
||||
szHwMouse db 'ATI2D',0
|
||||
szPS2MDriver db 'PS2MOUSE',0
|
||||
;szCOM_MDriver db 'COM_MOUSE',0
|
||||
szUSB db 'USB',0
|
||||
szAtiHW db '/rd/1/drivers/ati2d.drv',0
|
||||
|
||||
@ -155,13 +159,13 @@ firstapp db 'LAUNCHER',0
|
||||
notifyapp db '@notify',0
|
||||
if lang eq ru
|
||||
ud_user_message db 'Žè¨¡ª : ¥¯®¤¤¥à¦¨¢ ¥¬ ï ¨áâàãªæ¨ï ¯à®æ¥áá®à ',0
|
||||
else
|
||||
ud_user_message db 'Error: unsupported processor instruction',0
|
||||
end if
|
||||
|
||||
bootpath db '/KOLIBRI '
|
||||
bootpath2 db 0
|
||||
vmode db '/sys/drivers/VMODE.MDR',0
|
||||
else if ~ lang eq sp
|
||||
ud_user_message db 'Error: unsupported processor instruction',0
|
||||
end if
|
||||
|
||||
bootpath db '/KOLIBRI '
|
||||
bootpath2 db 0
|
||||
vmode db '/sys/drivers/VMODE.MDR',0
|
||||
;vrr_m db 'VRR_M',0
|
||||
kernel_file db 'KERNEL MNT'
|
||||
|
||||
|
40
kernel/branches/net/data32sp.inc
Normal file
40
kernel/branches/net/data32sp.inc
Normal file
@ -0,0 +1,40 @@
|
||||
boot_initirq db 'Inicializar IRQ',0
|
||||
boot_picinit db 'Inicializar PIC',0
|
||||
boot_v86machine db 'Inicializar sistema V86',0
|
||||
boot_inittimer db 'Inicializar reloj del sistema (IRQ0)',0
|
||||
boot_initapic db 'Prueba inicializar APIC',0
|
||||
boot_enableirq db 'Habilitar interrupciones 2, 6, 13, 14, 15',0
|
||||
boot_enablint_ide db 'Habiliar interrupciones en controladores IDE',0
|
||||
boot_detectfloppy db 'Buscar unidades de disquete',0
|
||||
boot_detecthdcd db 'Buscar discos duros y unidades ATAPI',0
|
||||
boot_getcache db 'Tomar memoria para cach‚',0
|
||||
boot_detectpart db 'Buscar particiones en discos',0
|
||||
boot_init_sys db 'Inicializar directorio del sistema /sys',0
|
||||
boot_loadlibs db 'Cargando librer¡as (.obj)',0
|
||||
boot_memdetect db 'Determinando cantidad de memoria',0
|
||||
boot_tss db 'Configurando TSSs',0
|
||||
boot_cpuid db 'Leyendo CPUIDs',0
|
||||
; boot_devices db 'Detectando dispositivos',0
|
||||
boot_setmouse db 'Configurando el rat¢n',0
|
||||
boot_windefs db 'Setting window defaults',0
|
||||
boot_bgr db 'Calculating background',0
|
||||
boot_resirqports db 'Reservando IRQs y puertos',0
|
||||
boot_setostask db 'Configurando tarea OS',0
|
||||
boot_allirqs db 'Desenmascarando IRQs',0
|
||||
boot_tsc db 'Leyendo TSC',0
|
||||
boot_cpufreq db 'La frequencia del CPU es ',' ',' MHz',0
|
||||
boot_pal_ega db 'Configurando paleta EGA/CGA 320x200',0
|
||||
boot_pal_vga db 'Configurando paleta VGA 640x480',0
|
||||
boot_failed db 'Fallo al iniciar la primer aplicaci¢n',0
|
||||
boot_mtrr db 'Configurando MTRR',0
|
||||
|
||||
boot_APIC_found db 'APIC habilitado', 0
|
||||
boot_APIC_nfound db 'APIC no encontrado', 0
|
||||
if preboot_blogesc
|
||||
boot_tasking db 'Todo configurado - presiona ESC para iniciar',0
|
||||
end if
|
||||
|
||||
msg_version db 'versi¢n incompatible del controlador',13,10,0
|
||||
msg_www db 'por favor, visita www.kolibrios.org',13,10,0
|
||||
|
||||
ud_user_message db 'Error: instrucci¢n no soportada por el procesador',0
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2008-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2008-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Detect all BIOS hard drives.
|
||||
; diamond, 2008
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2009-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
; Query physical memory map from BIOS.
|
||||
; diamond, 2009
|
||||
@ -20,14 +20,14 @@
|
||||
mov edx, 0x534D4150
|
||||
int 15h
|
||||
jc no_E820
|
||||
cmp eax, 0x534D4150
|
||||
jnz no_E820
|
||||
e820_mem_loop:
|
||||
; cmp byte [di+16], 1 ; ignore non-free areas
|
||||
; jnz e820_mem_next
|
||||
inc byte [0x9100]
|
||||
add di, 20
|
||||
e820_mem_next:
|
||||
cmp eax, 0x534D4150
|
||||
jnz no_E820
|
||||
e820_mem_loop:
|
||||
; cmp byte [di+16], 1 ; ignore non-free areas
|
||||
; jnz e820_mem_next
|
||||
inc byte [0x9100]
|
||||
add di, 20
|
||||
e820_mem_next:
|
||||
; consequent calls to fn E820
|
||||
test ebx, ebx
|
||||
jz e820_test_done
|
||||
|
@ -130,16 +130,16 @@ search_partitions_bd:
|
||||
end_search_partitions_bd:
|
||||
pop ecx
|
||||
inc [hdpos]
|
||||
loop start_search_partitions_bd
|
||||
jmp end_search_partitions
|
||||
|
||||
problem_partition db 0 ; used for partitions search
|
||||
|
||||
include '../fs/part_set.inc'
|
||||
|
||||
partition_data_transfer:
|
||||
mov edi, [transfer_adress]
|
||||
mov esi, PARTITION_START ;start of file_system_data
|
||||
loop start_search_partitions_bd
|
||||
jmp end_search_partitions
|
||||
|
||||
problem_partition db 0 ; used for partitions search
|
||||
|
||||
include '../fs/part_set.inc'
|
||||
|
||||
partition_data_transfer:
|
||||
mov edi, [transfer_adress]
|
||||
mov esi, PARTITION_START ;start of file_system_data
|
||||
mov ecx, (file_system_data_size+3)/4
|
||||
rep movsd
|
||||
ret
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -631,40 +631,40 @@ found_file_analyze_flp:
|
||||
; \begin{diamond}
|
||||
fat_find_lfn:
|
||||
; in: esi->name
|
||||
; [esp+4] = next
|
||||
; [esp+8] = first
|
||||
; [esp+C]... - possibly parameters for first and next
|
||||
; out: CF=1 - file not found, eax=error code
|
||||
; else CF=0, esi->next name component, edi->direntry
|
||||
pusha
|
||||
lea eax, [esp+0Ch+20h]
|
||||
call dword [eax-4]
|
||||
jc .reterr
|
||||
sub esp, 262*2 ; reserve place for LFN
|
||||
push 0 ; for fat_get_name: read ASCII name
|
||||
.l1:
|
||||
lea ebp, [esp+4]
|
||||
call fat_get_name
|
||||
jc .l2
|
||||
call fat_compare_name
|
||||
jz .found
|
||||
.l2:
|
||||
mov ebp, [esp+8+262*2+4]
|
||||
lea eax, [esp+0Ch+20h+262*2+4]
|
||||
call dword [eax-8]
|
||||
jnc .l1
|
||||
add esp, 262*2+4
|
||||
.reterr:
|
||||
mov [esp+28], eax
|
||||
stc
|
||||
popa
|
||||
ret
|
||||
.found:
|
||||
add esp, 262*2+4
|
||||
mov ebp, [esp+8]
|
||||
; if this is LFN entry, advance to true entry
|
||||
cmp byte [edi+11], 0xF
|
||||
jnz @f
|
||||
; [esp+4] = next
|
||||
; [esp+8] = first
|
||||
; [esp+C]... - possibly parameters for first and next
|
||||
; out: CF=1 - file not found, eax=error code
|
||||
; else CF=0, esi->next name component, edi->direntry
|
||||
pusha
|
||||
lea eax, [esp+0Ch+20h]
|
||||
call dword [eax-4]
|
||||
jc .reterr
|
||||
sub esp, 262*2 ; reserve place for LFN
|
||||
push 0 ; for fat_get_name: read ASCII name
|
||||
.l1:
|
||||
lea ebp, [esp+4]
|
||||
call fat_get_name
|
||||
jc .l2
|
||||
call fat_compare_name
|
||||
jz .found
|
||||
.l2:
|
||||
mov ebp, [esp+8+262*2+4]
|
||||
lea eax, [esp+0Ch+20h+262*2+4]
|
||||
call dword [eax-8]
|
||||
jnc .l1
|
||||
add esp, 262*2+4
|
||||
.reterr:
|
||||
mov [esp+28], eax
|
||||
stc
|
||||
popa
|
||||
ret
|
||||
.found:
|
||||
add esp, 262*2+4
|
||||
mov ebp, [esp+8]
|
||||
; if this is LFN entry, advance to true entry
|
||||
cmp byte [edi+11], 0xF
|
||||
jnz @f
|
||||
lea eax, [esp+0Ch+20h]
|
||||
call dword [eax-8]
|
||||
jc .reterr
|
||||
|
File diff suppressed because it is too large
Load Diff
13
kernel/branches/net/fs/fs-sp.inc
Normal file
13
kernel/branches/net/fs/fs-sp.inc
Normal file
@ -0,0 +1,13 @@
|
||||
dir0:
|
||||
db 'DISCO DURO '
|
||||
db 'UNIDAD RAM '
|
||||
db 'DISQUETE '
|
||||
db 0
|
||||
|
||||
dir1:
|
||||
db 'PRIMERO '
|
||||
db 'SEGUNDO '
|
||||
db 'TERCERO '
|
||||
db 'CUARTO '
|
||||
db 0
|
||||
|
@ -21,6 +21,10 @@ $Revision $
|
||||
|
||||
|
||||
iglobal
|
||||
|
||||
if lang eq sp
|
||||
include 'fs/fs-sp.inc'
|
||||
else
|
||||
dir0:
|
||||
db 'HARDDISK '
|
||||
db 'RAMDISK '
|
||||
@ -33,6 +37,7 @@ dir1:
|
||||
db 'THIRD '
|
||||
db 'FOURTH '
|
||||
db 0
|
||||
end if
|
||||
|
||||
not_select_IDE db 0
|
||||
|
||||
@ -166,12 +171,12 @@ endg
|
||||
and dword [esp+36], 0; ok read
|
||||
mov dword [esp+24], 32*2; size of root
|
||||
ret
|
||||
|
||||
fs_info: ;start of code - Mihasik
|
||||
push eax
|
||||
cmp [eax+21], byte 'r'
|
||||
je fs_info_r
|
||||
cmp [eax+21], byte 'R'
|
||||
|
||||
fs_info: ;start of code - Mihasik
|
||||
push eax
|
||||
cmp [eax+21], byte 'r'
|
||||
je fs_info_r
|
||||
cmp [eax+21], byte 'R'
|
||||
je fs_info_r
|
||||
mov eax, 3 ;if unknown disk
|
||||
xor ebx, ebx
|
||||
@ -182,12 +187,12 @@ endg
|
||||
call ramdisk_free_space;if ramdisk
|
||||
mov ecx, edi ;free space in ecx
|
||||
shr ecx, 9 ;free clusters
|
||||
mov ebx, 2847 ;total clusters
|
||||
mov edx, 512 ;cluster size
|
||||
xor eax, eax ;always 0
|
||||
fs_info1:
|
||||
pop edi
|
||||
mov [esp+36], eax
|
||||
mov ebx, 2847 ;total clusters
|
||||
mov edx, 512 ;cluster size
|
||||
xor eax, eax ;always 0
|
||||
fs_info1:
|
||||
pop edi
|
||||
mov [esp+36], eax
|
||||
mov [esp+24], ebx ; total clusters on disk
|
||||
mov [esp+32], ecx ; free clusters on disk
|
||||
mov [edi], edx ; cluster size in bytes
|
||||
@ -427,15 +432,15 @@ choice_necessity_partition_1:
|
||||
hd_err_return:
|
||||
call free_hd_channel
|
||||
and [hd1_status], 0
|
||||
jmp file_system_return
|
||||
@@:
|
||||
|
||||
call free_hd_channel
|
||||
and [hd1_status], 0
|
||||
|
||||
fs_noharddisk:
|
||||
; \begin{diamond}[18.03.2006]
|
||||
mov eax, 5 ; file not found
|
||||
jmp file_system_return
|
||||
@@:
|
||||
|
||||
call free_hd_channel
|
||||
and [hd1_status], 0
|
||||
|
||||
fs_noharddisk:
|
||||
; \begin{diamond}[18.03.2006]
|
||||
mov eax, 5 ; file not found
|
||||
; à ìîæåò áûòü, âîçâðàùàòü äðóãîé êîä îøèáêè?
|
||||
mov ebx, [esp+24+24]; do not change ebx in application
|
||||
; \end{diamond}[18.03.2006]
|
||||
|
@ -134,6 +134,15 @@ fs_additional_handlers:
|
||||
|
||||
endg
|
||||
|
||||
file_system_lfn_protected:
|
||||
pushad
|
||||
call protect_from_terminate
|
||||
call file_system_lfn
|
||||
call unprotect_from_terminate
|
||||
popad
|
||||
mov [image_of_eax], eax
|
||||
mov [image_of_ebx], ebx
|
||||
ret
|
||||
|
||||
file_system_lfn:
|
||||
; in: ebx->fileinfo block
|
||||
|
@ -30,15 +30,15 @@ PARTITION_END dd 0
|
||||
fs_type db 0 ; 1=NTFS, 2=EXT2/3, 16=FAT16, 32=FAT32
|
||||
align 4
|
||||
|
||||
fs_dependent_data_start:
|
||||
; FATxx data
|
||||
|
||||
.partition dd ?
|
||||
rb 80
|
||||
|
||||
fs_dependent_data_end:
|
||||
file_system_data_size = $ - PARTITION_START
|
||||
if file_system_data_size > 96
|
||||
fs_dependent_data_start:
|
||||
; FATxx data
|
||||
|
||||
.partition dd ?
|
||||
rb 80
|
||||
|
||||
fs_dependent_data_end:
|
||||
file_system_data_size = $ - PARTITION_START
|
||||
if file_system_data_size > 96
|
||||
ERROR:
|
||||
sizeof(file system data) too big!
|
||||
end if
|
||||
@ -69,12 +69,12 @@ virtual at fs_dependent_data_start
|
||||
; EXT2 data
|
||||
ext2_data:
|
||||
.log_block_size dd ?
|
||||
.block_size dd ?
|
||||
.count_block_in_block dd ?
|
||||
.blocks_per_group dd ?
|
||||
.global_desc_table dd ?
|
||||
.root_inode dd ? ; pointer to root inode in memory
|
||||
.inode_size dd ?
|
||||
.block_size dd ?
|
||||
.count_block_in_block dd ?
|
||||
.blocks_per_group dd ?
|
||||
.global_desc_table dd ?
|
||||
.root_inode dd ? ; pointer to root inode in memory
|
||||
.inode_size dd ?
|
||||
.count_pointer_in_block dd ? ; block_size / 4
|
||||
.count_pointer_in_block_square dd ? ; (block_size / 4)**2
|
||||
.ext2_save_block dd ? ; ¡«®ª £«®¡ «ìãî 1 ¯à®æ¥¤ãàã
|
||||
@ -407,30 +407,30 @@ boot_read_ok:
|
||||
|
||||
mov eax, [PARTITION_START] ;ext2 test changes [buffer]
|
||||
call hd_read
|
||||
cmp [hd_error], 0
|
||||
jnz problem_fat_dec_count
|
||||
|
||||
push 0
|
||||
mov eax, [PARTITION_END]
|
||||
sub eax, [PARTITION_START]
|
||||
inc eax
|
||||
push eax
|
||||
push 0
|
||||
push [PARTITION_START]
|
||||
push ebp
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
mov esi, 'old' ; special value: there is no DISK structure
|
||||
push 1 ; bootsector read successfully
|
||||
call fat_create_partition
|
||||
add esp, 4*7
|
||||
test eax, eax
|
||||
jz problem_fat_dec_count
|
||||
mov [fs_dependent_data_start.partition], eax
|
||||
mov al, [eax+FAT.fs_type]
|
||||
mov [fs_type], al
|
||||
|
||||
popad
|
||||
call free_hd_channel
|
||||
mov [hd1_status], 0 ; free
|
||||
ret
|
||||
cmp [hd_error], 0
|
||||
jnz problem_fat_dec_count
|
||||
|
||||
push 0
|
||||
mov eax, [PARTITION_END]
|
||||
sub eax, [PARTITION_START]
|
||||
inc eax
|
||||
push eax
|
||||
push 0
|
||||
push [PARTITION_START]
|
||||
push ebp
|
||||
push ebp
|
||||
mov ebp, esp
|
||||
mov esi, 'old' ; special value: there is no DISK structure
|
||||
push 1 ; bootsector read successfully
|
||||
call fat_create_partition
|
||||
add esp, 4*7
|
||||
test eax, eax
|
||||
jz problem_fat_dec_count
|
||||
mov [fs_dependent_data_start.partition], eax
|
||||
mov al, [eax+FAT.fs_type]
|
||||
mov [fs_type], al
|
||||
|
||||
popad
|
||||
call free_hd_channel
|
||||
mov [hd1_status], 0 ; free
|
||||
ret
|
||||
|
@ -467,9 +467,11 @@ sys_waitforevent: ;; f10
|
||||
;--------------------------------------
|
||||
align 4
|
||||
sys_wait_event_timeout: ;; f23
|
||||
call unprotect_from_terminate
|
||||
mov edx, get_event_for_app; wait_test
|
||||
call Wait_events_ex ; ebx - timeout
|
||||
mov [esp+32], eax
|
||||
call protect_from_terminate
|
||||
ret
|
||||
;-----------------------------------------------------------------------------
|
||||
align 4
|
||||
|
@ -225,15 +225,15 @@ draw_text_to_user_area:
|
||||
add eax, 8
|
||||
and ecx, 0xffffff
|
||||
or ecx, 0xff000000 ; not transparent
|
||||
mov [eax], ecx ; store pixel
|
||||
popad
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
FONT_I:
|
||||
file 'char.mt'
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
FONT_II:
|
||||
file 'char2.mt'
|
||||
mov [eax], ecx ; store pixel
|
||||
popad
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
FONT_I:
|
||||
file 'char.mt'
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
FONT_II:
|
||||
file 'char2.mt'
|
||||
;------------------------------------------------------------------------------
|
@ -255,14 +255,14 @@ mouse._.left_button_press_handler: ;///////////////////////////////////////////
|
||||
@@:
|
||||
test dl, mouse.WINDOW_RESIZE_E_FLAG
|
||||
jz .call_window_handler
|
||||
call .calculate_e_delta
|
||||
|
||||
.call_window_handler:
|
||||
; mov eax, mouse.active_sys_window.old_box
|
||||
; call sys_window_start_moving_handler
|
||||
|
||||
.exit:
|
||||
ret
|
||||
call .calculate_e_delta
|
||||
|
||||
.call_window_handler:
|
||||
; mov eax, mouse.active_sys_window.old_box
|
||||
; call sys_window_start_moving_handler
|
||||
|
||||
.exit:
|
||||
ret
|
||||
|
||||
.calculate_n_delta:
|
||||
mov eax, [mouse.state.pos.y]
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision: 2288 $
|
||||
|
||||
|
@ -1023,61 +1023,61 @@ align 4
|
||||
mov byte[MOUSE_DOWN], 0
|
||||
inc eax
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
minimize_all_window:
|
||||
push ebx ecx edx esi edi
|
||||
pushfd
|
||||
cli
|
||||
xor edx, edx
|
||||
mov eax, 2 ; we do not minimize the kernel thread N1
|
||||
mov ebx, [TASK_COUNT]
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.loop:
|
||||
movzx edi, word[WIN_POS + eax * 2]
|
||||
shl edi, 5
|
||||
; it is a unused slot?
|
||||
cmp dword [edi+CURRENT_TASK+TASKDATA.state], 9
|
||||
je @f
|
||||
; it is a hidden thread?
|
||||
lea esi, [edi*8+SLOT_BASE+APPDATA.app_name]
|
||||
cmp [esi], byte '@'
|
||||
je @f
|
||||
; is it already minimized?
|
||||
test [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
jnz @f
|
||||
; no it's not, let's do that
|
||||
or [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
inc edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
inc eax
|
||||
cmp eax, ebx
|
||||
jbe .loop
|
||||
; If nothing has changed
|
||||
test edx, edx
|
||||
jz @f
|
||||
|
||||
push edx
|
||||
call syscall_display_settings._.calculate_whole_screen
|
||||
call syscall_display_settings._.redraw_whole_screen
|
||||
pop edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov eax, edx
|
||||
popfd
|
||||
pop edi esi edx ecx ebx
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
minimize_window: ;/////////////////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;> eax = window number on screen
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
minimize_all_window:
|
||||
push ebx ecx edx esi edi
|
||||
pushfd
|
||||
cli
|
||||
xor edx, edx
|
||||
mov eax, 2 ; we do not minimize the kernel thread N1
|
||||
mov ebx, [TASK_COUNT]
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.loop:
|
||||
movzx edi, word[WIN_POS + eax * 2]
|
||||
shl edi, 5
|
||||
; it is a unused slot?
|
||||
cmp dword [edi+CURRENT_TASK+TASKDATA.state], 9
|
||||
je @f
|
||||
; it is a hidden thread?
|
||||
lea esi, [edi*8+SLOT_BASE+APPDATA.app_name]
|
||||
cmp [esi], byte '@'
|
||||
je @f
|
||||
; is it already minimized?
|
||||
test [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
jnz @f
|
||||
; no it's not, let's do that
|
||||
or [edi + window_data+WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
inc edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
inc eax
|
||||
cmp eax, ebx
|
||||
jbe .loop
|
||||
; If nothing has changed
|
||||
test edx, edx
|
||||
jz @f
|
||||
|
||||
push edx
|
||||
call syscall_display_settings._.calculate_whole_screen
|
||||
call syscall_display_settings._.redraw_whole_screen
|
||||
pop edx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
mov eax, edx
|
||||
popfd
|
||||
pop edi esi edx ecx ebx
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
minimize_window: ;/////////////////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;> eax = window number on screen
|
||||
;------------------------------------------------------------------------------
|
||||
;# corrupts [dl*]
|
||||
;------------------------------------------------------------------------------
|
||||
@ -1093,43 +1093,43 @@ minimize_window: ;/////////////////////////////////////////////////////////////
|
||||
jnz .exit
|
||||
|
||||
push eax ebx ecx edx esi
|
||||
|
||||
; no it's not, let's do that
|
||||
or [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
; If the window width is 0, then the action is not needed.
|
||||
cmp [edi + WDATA.box.width], dword 0
|
||||
je @f
|
||||
; If the window height is 0, then the action is not needed.
|
||||
cmp [edi + WDATA.box.height], dword 0
|
||||
je @f
|
||||
|
||||
mov eax, [edi + WDATA.box.left]
|
||||
mov [draw_limits.left], eax
|
||||
mov ecx, eax
|
||||
|
||||
; no it's not, let's do that
|
||||
or [edi + WDATA.fl_wstate], WSTATE_MINIMIZED
|
||||
; If the window width is 0, then the action is not needed.
|
||||
cmp [edi + WDATA.box.width], dword 0
|
||||
je @f
|
||||
; If the window height is 0, then the action is not needed.
|
||||
cmp [edi + WDATA.box.height], dword 0
|
||||
je @f
|
||||
|
||||
mov eax, [edi + WDATA.box.left]
|
||||
mov [draw_limits.left], eax
|
||||
mov ecx, eax
|
||||
add ecx, [edi + WDATA.box.width]
|
||||
mov [draw_limits.right], ecx
|
||||
mov ebx, [edi + WDATA.box.top]
|
||||
mov [draw_limits.top], ebx
|
||||
mov edx, ebx
|
||||
add edx, [edi + WDATA.box.height]
|
||||
mov [draw_limits.bottom], edx
|
||||
|
||||
; DEBUGF 1, "K : minimize_window\n"
|
||||
; DEBUGF 1, "K : dl_left %x\n",[draw_limits.left]
|
||||
; DEBUGF 1, "K : dl_right %x\n",[draw_limits.right]
|
||||
; DEBUGF 1, "K : dl_top %x\n",[draw_limits.top]
|
||||
; DEBUGF 1, "K : dl_bottom %x\n",[draw_limits.bottom]
|
||||
call calculatescreen
|
||||
; xor esi, esi
|
||||
; xor eax, eax
|
||||
mov eax, edi
|
||||
call redrawscreen
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop esi edx ecx ebx eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
mov edx, ebx
|
||||
add edx, [edi + WDATA.box.height]
|
||||
mov [draw_limits.bottom], edx
|
||||
|
||||
; DEBUGF 1, "K : minimize_window\n"
|
||||
; DEBUGF 1, "K : dl_left %x\n",[draw_limits.left]
|
||||
; DEBUGF 1, "K : dl_right %x\n",[draw_limits.right]
|
||||
; DEBUGF 1, "K : dl_top %x\n",[draw_limits.top]
|
||||
; DEBUGF 1, "K : dl_bottom %x\n",[draw_limits.bottom]
|
||||
call calculatescreen
|
||||
; xor esi, esi
|
||||
; xor eax, eax
|
||||
mov eax, edi
|
||||
call redrawscreen
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop esi edx ecx ebx eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.exit:
|
||||
popfd
|
||||
pop edi
|
||||
@ -1328,35 +1328,35 @@ align 4
|
||||
call window._.set_window_box
|
||||
add esp, sizeof.BOX
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
;sys_window_start_moving_handler: ;/////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? <description>
|
||||
;------------------------------------------------------------------------------
|
||||
;> eax = old (original) window box
|
||||
;> esi = process slot
|
||||
;------------------------------------------------------------------------------
|
||||
; mov edi, eax
|
||||
; call window._.draw_negative_box
|
||||
; ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
;sys_window_start_moving_handler: ;/////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? <description>
|
||||
;------------------------------------------------------------------------------
|
||||
;> eax = old (original) window box
|
||||
;> esi = process slot
|
||||
;------------------------------------------------------------------------------
|
||||
; mov edi, eax
|
||||
; call window._.draw_negative_box
|
||||
; ret
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
sys_window_end_moving_handler: ;///////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? <description>
|
||||
;------------------------------------------------------------------------------
|
||||
;> eax = old (original) window box
|
||||
;> ebx = new (final) window box
|
||||
;> esi = process slot
|
||||
;------------------------------------------------------------------------------
|
||||
; mov edi, ebx
|
||||
; call window._.end_moving__box
|
||||
|
||||
mov edi, esi
|
||||
shl edi, 5
|
||||
;> ebx = new (final) window box
|
||||
;> esi = process slot
|
||||
;------------------------------------------------------------------------------
|
||||
; mov edi, ebx
|
||||
; call window._.end_moving__box
|
||||
|
||||
mov edi, esi
|
||||
shl edi, 5
|
||||
add edi, window_data
|
||||
|
||||
mov eax, ebx
|
||||
@ -2381,23 +2381,23 @@ align 4
|
||||
mov bx, word[edi + BOX.top]
|
||||
add bx, word[edi + BOX.height]
|
||||
call draw_rectangle.forced
|
||||
pop esi ebx eax
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
;align 4
|
||||
;------------------------------------------------------------------------------
|
||||
;window._.end_moving__box: ;//////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? Draw positive box
|
||||
;------------------------------------------------------------------------------
|
||||
;> edi = pointer to BOX struct
|
||||
;------------------------------------------------------------------------------
|
||||
; push eax ebx esi
|
||||
; xor esi, esi
|
||||
; jmp window._.draw_negative_box.1
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
pop esi ebx eax
|
||||
ret
|
||||
;------------------------------------------------------------------------------
|
||||
;align 4
|
||||
;------------------------------------------------------------------------------
|
||||
;window._.end_moving__box: ;//////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? Draw positive box
|
||||
;------------------------------------------------------------------------------
|
||||
;> edi = pointer to BOX struct
|
||||
;------------------------------------------------------------------------------
|
||||
; push eax ebx esi
|
||||
; xor esi, esi
|
||||
; jmp window._.draw_negative_box.1
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
;------------------------------------------------------------------------------
|
||||
window._.get_rect: ;/////////////////////////////////////////////////////
|
||||
;------------------------------------------------------------------------------
|
||||
;? <description> void __fastcall get_window_rect(struct RECT* rc);
|
||||
|
@ -17,6 +17,8 @@ VKEY_RALT = 0000000000100000b
|
||||
VKEY_CAPSLOCK = 0000000001000000b
|
||||
VKEY_NUMLOCK = 0000000010000000b
|
||||
VKEY_SCRLOCK = 0000000100000000b
|
||||
VKEY_LWIN = 0000001000000000b
|
||||
VKEY_RWIN = 0000010000000000b
|
||||
|
||||
VKEY_SHIFT = 0000000000000011b
|
||||
VKEY_CONTROL = 0000000000001100b
|
||||
@ -224,6 +226,29 @@ send_scancode:
|
||||
xchg cl, [ext_code]
|
||||
and al, 0x7F
|
||||
mov bh, 1
|
||||
;--------------------------------------
|
||||
@@:
|
||||
cmp al, 0x5B
|
||||
jne @f
|
||||
|
||||
cmp cl, 0xE0
|
||||
jne @f
|
||||
|
||||
mov eax, VKEY_LWIN
|
||||
mov bh, 0
|
||||
jmp .modifier
|
||||
;--------------------------------------
|
||||
@@:
|
||||
cmp al, 0x5C
|
||||
jne @f
|
||||
|
||||
cmp cl, 0xE0
|
||||
jne @f
|
||||
|
||||
mov eax, VKEY_RWIN
|
||||
mov bh, 0
|
||||
jmp .modifier
|
||||
;--------------------------------------
|
||||
@@:
|
||||
cmp al, 0x2A
|
||||
jne @f
|
||||
@ -359,9 +384,6 @@ send_scancode:
|
||||
|
||||
xor [kb_state], eax
|
||||
xor [kb_lights], bl
|
||||
push ecx
|
||||
call set_lights
|
||||
pop ecx
|
||||
.writekey:
|
||||
pushad
|
||||
; test for system hotkeys
|
||||
@ -495,10 +517,12 @@ set_lights:
|
||||
ret
|
||||
|
||||
ps2_set_lights:
|
||||
stdcall disable_irq, 1
|
||||
mov al, 0xED
|
||||
call kb_write
|
||||
mov al, [esp+8]
|
||||
call kb_write
|
||||
stdcall enable_irq, 1
|
||||
ret 8
|
||||
|
||||
;// mike.dld ]
|
||||
|
@ -23,20 +23,20 @@ $Revision $
|
||||
|
||||
uglobal
|
||||
;--------------------------------------
|
||||
align 4
|
||||
mousecount dd 0x0
|
||||
mousedata dd 0x0
|
||||
Y_UNDER_sub_CUR_hot_y_add_curh:
|
||||
dw 0
|
||||
Y_UNDER_subtraction_CUR_hot_y:
|
||||
dw 0
|
||||
X_UNDER_sub_CUR_hot_x_add_curh:
|
||||
dw 0
|
||||
X_UNDER_subtraction_CUR_hot_x:
|
||||
dw 0
|
||||
endg
|
||||
|
||||
iglobal
|
||||
align 4
|
||||
mousecount dd 0x0
|
||||
mousedata dd 0x0
|
||||
Y_UNDER_sub_CUR_hot_y_add_curh:
|
||||
dw 0
|
||||
Y_UNDER_subtraction_CUR_hot_y:
|
||||
dw 0
|
||||
X_UNDER_sub_CUR_hot_x_add_curh:
|
||||
dw 0
|
||||
X_UNDER_subtraction_CUR_hot_x:
|
||||
dw 0
|
||||
endg
|
||||
|
||||
iglobal
|
||||
;--------------------------------------
|
||||
align 4
|
||||
mouse_delay dd 10
|
||||
@ -121,24 +121,24 @@ save_draw_mouse:
|
||||
shl edx, 8
|
||||
mov esi, [edx+SLOT_BASE+APPDATA.cursor]
|
||||
|
||||
cmp esi, [current_cursor]
|
||||
je .draw
|
||||
|
||||
mov eax, [TASK_COUNT]
|
||||
movzx eax, word [WIN_POS+eax*2]
|
||||
shl eax, 8
|
||||
|
||||
cmp eax, edx
|
||||
je @F
|
||||
|
||||
mov esi, [def_cursor]
|
||||
cmp esi, [current_cursor]
|
||||
je .draw
|
||||
|
||||
@@:
|
||||
push esi
|
||||
call [_display.select_cursor]
|
||||
mov [current_cursor], esi
|
||||
cmp esi, [current_cursor]
|
||||
je .draw
|
||||
|
||||
mov eax, [TASK_COUNT]
|
||||
movzx eax, word [WIN_POS+eax*2]
|
||||
shl eax, 8
|
||||
|
||||
cmp eax, edx
|
||||
je @F
|
||||
|
||||
mov esi, [def_cursor]
|
||||
cmp esi, [current_cursor]
|
||||
je .draw
|
||||
|
||||
@@:
|
||||
push esi
|
||||
call [_display.select_cursor]
|
||||
mov [current_cursor], esi
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.draw:
|
||||
@ -456,21 +456,21 @@ redrawmouse:
|
||||
|
||||
xor eax, eax
|
||||
mov esi, [current_cursor]
|
||||
|
||||
mov ax, [Y_UNDER]
|
||||
sub eax, [esi+CURSOR.hot_y]
|
||||
mov [Y_UNDER_subtraction_CUR_hot_y], ax
|
||||
add eax, [cur.h]
|
||||
mov [Y_UNDER_sub_CUR_hot_y_add_curh], ax
|
||||
|
||||
mov ax, [X_UNDER]
|
||||
sub eax, [esi+CURSOR.hot_x]
|
||||
mov [X_UNDER_subtraction_CUR_hot_x], ax
|
||||
add eax, [cur.w]
|
||||
mov [X_UNDER_sub_CUR_hot_x_add_curh], ax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
|
||||
mov ax, [Y_UNDER]
|
||||
sub eax, [esi+CURSOR.hot_y]
|
||||
mov [Y_UNDER_subtraction_CUR_hot_y], ax
|
||||
add eax, [cur.h]
|
||||
mov [Y_UNDER_sub_CUR_hot_y_add_curh], ax
|
||||
|
||||
mov ax, [X_UNDER]
|
||||
sub eax, [esi+CURSOR.hot_x]
|
||||
mov [X_UNDER_subtraction_CUR_hot_x], ax
|
||||
add eax, [cur.w]
|
||||
mov [X_UNDER_sub_CUR_hot_x_add_curh], ax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
popfd
|
||||
;--------------------------------------
|
||||
align 4
|
||||
|
@ -77,7 +77,7 @@ $Revision $
|
||||
USE_COM_IRQ equ 1 ; make irq 3 and irq 4 available for PCI devices
|
||||
|
||||
; Enabling the next line will enable serial output console
|
||||
;debug_com_base equ 0x2f8 ; 0x3f8 is com1, 0x2f8 is com2, 0x3e8 is com3, 0x2e8 is com4, no irq's are used
|
||||
;debug_com_base equ 0x3f8 ; 0x3f8 is com1, 0x2f8 is com2, 0x3e8 is com3, 0x2e8 is com4, no irq's are used
|
||||
|
||||
include "proc32.inc"
|
||||
include "kglobals.inc"
|
||||
@ -133,13 +133,19 @@ use16
|
||||
org 0x0
|
||||
jmp start_of_code
|
||||
|
||||
version db 'Kolibri OS network branch ',13,10,13,10,0
|
||||
if lang eq sp
|
||||
include "kernelsp.inc" ; spanish kernel messages
|
||||
else
|
||||
version db 'Kolibri OS version 0.7.7.0+ ',13,10,13,10,0
|
||||
end if
|
||||
|
||||
include "boot/bootstr.inc" ; language-independent boot messages
|
||||
include "boot/preboot.inc"
|
||||
|
||||
if lang eq en
|
||||
include "boot/booteng.inc" ; english system boot messages
|
||||
if lang eq ge
|
||||
include "boot/bootge.inc" ; german system boot messages
|
||||
else if lang eq sp
|
||||
include "boot/bootsp.inc" ; spanish system boot messages
|
||||
else if lang eq ru
|
||||
include "boot/bootru.inc" ; russian system boot messages
|
||||
include "boot/ru.inc" ; Russian font
|
||||
@ -147,7 +153,7 @@ else if lang eq et
|
||||
include "boot/bootet.inc" ; estonian system boot messages
|
||||
include "boot/et.inc" ; Estonian font
|
||||
else
|
||||
include "boot/bootge.inc" ; german system boot messages
|
||||
include "boot/booten.inc" ; english system boot messages
|
||||
end if
|
||||
|
||||
include "boot/bootcode.inc" ; 16 bit system boot code
|
||||
@ -608,6 +614,52 @@ no_mode_0x12:
|
||||
mov [mem_BACKGROUND], 4
|
||||
mov [img_background], static_background_data
|
||||
|
||||
; SET UP OS TASK
|
||||
|
||||
mov esi, boot_setostask
|
||||
call boot_log
|
||||
|
||||
xor eax, eax
|
||||
mov dword [SLOT_BASE+APPDATA.fpu_state], fpu_data
|
||||
mov dword [SLOT_BASE+APPDATA.exc_handler], eax
|
||||
mov dword [SLOT_BASE+APPDATA.except_mask], eax
|
||||
|
||||
; name for OS/IDLE process
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.app_name], dword 'OS/I'
|
||||
mov dword [SLOT_BASE+256+APPDATA.app_name+4], dword 'DLE '
|
||||
mov edi, [os_stack_seg]
|
||||
mov dword [SLOT_BASE+256+APPDATA.pl0_stack], edi
|
||||
add edi, 0x2000-512
|
||||
mov dword [SLOT_BASE+256+APPDATA.fpu_state], edi
|
||||
mov dword [SLOT_BASE+256+APPDATA.saved_esp0], edi; just for case
|
||||
mov dword [SLOT_BASE+256+APPDATA.terminate_protection], 80000001h
|
||||
|
||||
mov esi, fpu_data
|
||||
mov ecx, 512/4
|
||||
cld
|
||||
rep movsd
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.exc_handler], eax
|
||||
mov dword [SLOT_BASE+256+APPDATA.except_mask], eax
|
||||
|
||||
mov ebx, SLOT_BASE+256+APP_OBJ_OFFSET
|
||||
mov dword [SLOT_BASE+256+APPDATA.fd_obj], ebx
|
||||
mov dword [SLOT_BASE+256+APPDATA.bk_obj], ebx
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.cur_dir], sysdir_path
|
||||
mov dword [SLOT_BASE+256+APPDATA.tls_base], eax
|
||||
|
||||
; task list
|
||||
mov dword [TASK_DATA+TASKDATA.mem_start], eax; process base address
|
||||
inc eax
|
||||
mov dword [CURRENT_TASK], eax
|
||||
mov dword [TASK_COUNT], eax
|
||||
mov [current_slot], SLOT_BASE+256
|
||||
mov [TASK_BASE], dword TASK_DATA
|
||||
mov byte[TASK_DATA+TASKDATA.wnd_number], al ; on screen number
|
||||
mov dword [TASK_DATA+TASKDATA.pid], eax ; process id number
|
||||
|
||||
mov [SLOT_BASE + 256 + APPDATA.dir_table], sys_pgdir - OS_BASE
|
||||
|
||||
; REDIRECT ALL IRQ'S TO INT'S 0x20-0x2f
|
||||
@ -718,9 +770,11 @@ end if
|
||||
movzx ecx, word [boot_y]
|
||||
if lang eq ru
|
||||
or ecx, (10+30*6) shl 16
|
||||
else
|
||||
else if lang eq sp
|
||||
or ecx, (10+33*6) shl 16
|
||||
else
|
||||
or ecx, (10+29*6) shl 16
|
||||
end if
|
||||
end if
|
||||
sub ecx, 10
|
||||
mov edx, 0xFFFFFF
|
||||
mov ebx, [MEM_AMOUNT]
|
||||
@ -739,7 +793,6 @@ end if
|
||||
|
||||
mov [pci_access_enabled], 1
|
||||
|
||||
|
||||
; SET PRELIMINARY WINDOW STACK AND POSITIONS
|
||||
|
||||
mov esi, boot_windefs
|
||||
@ -759,52 +812,6 @@ end if
|
||||
call boot_log
|
||||
call reserve_irqs_ports
|
||||
|
||||
; SET UP OS TASK
|
||||
|
||||
mov esi, boot_setostask
|
||||
call boot_log
|
||||
|
||||
xor eax, eax
|
||||
mov dword [SLOT_BASE+APPDATA.fpu_state], fpu_data
|
||||
mov dword [SLOT_BASE+APPDATA.exc_handler], eax
|
||||
mov dword [SLOT_BASE+APPDATA.except_mask], eax
|
||||
|
||||
; name for OS/IDLE process
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.app_name], dword 'OS/I'
|
||||
mov dword [SLOT_BASE+256+APPDATA.app_name+4], dword 'DLE '
|
||||
mov edi, [os_stack_seg]
|
||||
mov dword [SLOT_BASE+256+APPDATA.pl0_stack], edi
|
||||
add edi, 0x2000-512
|
||||
mov dword [SLOT_BASE+256+APPDATA.fpu_state], edi
|
||||
mov dword [SLOT_BASE+256+APPDATA.saved_esp0], edi; just for case
|
||||
; [SLOT_BASE+256+APPDATA.io_map] was set earlier
|
||||
|
||||
mov esi, fpu_data
|
||||
mov ecx, 512/4
|
||||
cld
|
||||
rep movsd
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.exc_handler], eax
|
||||
mov dword [SLOT_BASE+256+APPDATA.except_mask], eax
|
||||
|
||||
mov ebx, SLOT_BASE+256+APP_OBJ_OFFSET
|
||||
mov dword [SLOT_BASE+256+APPDATA.fd_obj], ebx
|
||||
mov dword [SLOT_BASE+256+APPDATA.bk_obj], ebx
|
||||
|
||||
mov dword [SLOT_BASE+256+APPDATA.cur_dir], sysdir_path
|
||||
mov dword [SLOT_BASE+256+APPDATA.tls_base], eax
|
||||
|
||||
; task list
|
||||
mov dword [TASK_DATA+TASKDATA.mem_start], eax; process base address
|
||||
inc eax
|
||||
mov dword [CURRENT_TASK], eax
|
||||
mov dword [TASK_COUNT], eax
|
||||
mov [current_slot], SLOT_BASE+256
|
||||
mov [TASK_BASE], dword TASK_DATA
|
||||
mov byte[TASK_DATA+TASKDATA.wnd_number], al ; on screen number
|
||||
mov dword [TASK_DATA+TASKDATA.pid], eax ; process id number
|
||||
|
||||
call init_display
|
||||
mov eax, [def_cursor]
|
||||
mov [SLOT_BASE+APPDATA.cursor], eax
|
||||
@ -841,9 +848,11 @@ end if
|
||||
movzx ecx, word [boot_y]
|
||||
if lang eq ru
|
||||
add ecx, (10+19*6) shl 16 - 10 ; 'Determining amount of memory'
|
||||
else
|
||||
else if lang eq sp
|
||||
add ecx, (10+25*6) shl 16 - 10 ; 'Determining amount of memory'
|
||||
else
|
||||
add ecx, (10+17*6) shl 16 - 10 ; 'Determining amount of memory'
|
||||
end if
|
||||
end if
|
||||
mov edx, 0xFFFFFF
|
||||
xor edi, edi
|
||||
mov eax, 0x00040000
|
||||
@ -912,8 +921,8 @@ end if
|
||||
call fs_execute_from_sysdir
|
||||
|
||||
; cmp eax,2 ; continue if a process has been loaded
|
||||
sub eax, 2
|
||||
jz first_app_found
|
||||
test eax, eax
|
||||
jns first_app_found
|
||||
|
||||
mov esi, boot_failed
|
||||
call boot_log
|
||||
@ -2089,17 +2098,21 @@ sysfn_terminate: ; 18.2 = TERMINATE
|
||||
push ecx
|
||||
cmp ecx, 2
|
||||
jb noprocessterminate
|
||||
|
||||
cmp ecx, [TASK_COUNT]
|
||||
mov edx, [TASK_COUNT]
|
||||
cmp ecx, edx
|
||||
ja noprocessterminate
|
||||
|
||||
shl ecx, 5
|
||||
mov eax, [TASK_COUNT]
|
||||
shl ecx, 5
|
||||
mov edx, [ecx+CURRENT_TASK+TASKDATA.pid]
|
||||
|
||||
add ecx, CURRENT_TASK+TASKDATA.state
|
||||
cmp byte [ecx], 9
|
||||
jz noprocessterminate
|
||||
push ecx edx
|
||||
lea edx, [(ecx-(CURRENT_TASK and 1FFFFFFFh)-TASKDATA.state)*8+SLOT_BASE]
|
||||
call request_terminate
|
||||
pop edx ecx
|
||||
test eax, eax
|
||||
jz noprocessterminate
|
||||
;--------------------------------------
|
||||
; terminate all network sockets it used
|
||||
pusha
|
||||
@ -3476,15 +3489,31 @@ nobackgr:
|
||||
mov edx, [shutdown_processes]
|
||||
|
||||
cmp [SYS_SHUTDOWN], dl
|
||||
jne no_mark_system_shutdown
|
||||
jne noshutdown
|
||||
|
||||
lea ecx, [edx-1]
|
||||
mov edx, OS_BASE+0x3040
|
||||
jecxz @f
|
||||
jecxz no_mark_system_shutdown
|
||||
;--------------------------------------
|
||||
align 4
|
||||
markz:
|
||||
push ecx edx
|
||||
cmp [edx+TASKDATA.state], 9
|
||||
jz .nokill
|
||||
lea edx, [(edx-(CURRENT_TASK and 1FFFFFFFh))*8+SLOT_BASE]
|
||||
cmp [edx+APPDATA.dir_table], sys_pgdir - OS_BASE
|
||||
jz .nokill
|
||||
call request_terminate
|
||||
jmp .common
|
||||
.nokill:
|
||||
dec byte [SYS_SHUTDOWN]
|
||||
xor eax, eax
|
||||
.common:
|
||||
pop edx ecx
|
||||
test eax, eax
|
||||
jz @f
|
||||
mov [edx+TASKDATA.state], byte 3
|
||||
@@:
|
||||
add edx, 0x20
|
||||
loop markz
|
||||
;--------------------------------------
|
||||
@ -3504,11 +3533,20 @@ align 4
|
||||
newct:
|
||||
mov cl, [ebx]
|
||||
cmp cl, byte 3
|
||||
jz terminate
|
||||
jz .terminate
|
||||
|
||||
cmp cl, byte 4
|
||||
jz terminate
|
||||
jnz .noterminate
|
||||
.terminate:
|
||||
pushad
|
||||
call terminate
|
||||
popad
|
||||
cmp byte [SYS_SHUTDOWN], 0
|
||||
jz .noterminate
|
||||
dec byte [SYS_SHUTDOWN]
|
||||
je system_shutdown
|
||||
|
||||
.noterminate:
|
||||
add ebx, 0x20
|
||||
inc esi
|
||||
dec eax
|
||||
@ -3718,6 +3756,15 @@ set_app_param:
|
||||
mov [esp+32], eax ; return old mask value
|
||||
ret
|
||||
;-----------------------------------------------------------------------------
|
||||
|
||||
; this is for syscall
|
||||
proc delay_hs_unprotected
|
||||
call unprotect_from_terminate
|
||||
call delay_hs
|
||||
call protect_from_terminate
|
||||
ret
|
||||
endp
|
||||
|
||||
align 4
|
||||
delay_hs: ; delay in 1/100 secs
|
||||
; ebx = delay time
|
||||
@ -5606,4 +5653,6 @@ include "data32.inc"
|
||||
__REV__ = __REV
|
||||
|
||||
uglobals_size = $ - endofcode
|
||||
if ~ lang eq sp
|
||||
diff16 "end of kernel code",0,$
|
||||
end if
|
||||
|
@ -137,7 +137,7 @@ struct APPDATA
|
||||
ipc_size dd ?
|
||||
event_mask dd ?
|
||||
debugger_slot dd ?
|
||||
dd ?
|
||||
terminate_protection dd ?
|
||||
keyboard_mode db ?
|
||||
rb 3
|
||||
dir_table dd ?
|
||||
|
4
kernel/branches/net/kernelsp.inc
Normal file
4
kernel/branches/net/kernelsp.inc
Normal file
@ -0,0 +1,4 @@
|
||||
; <EFBFBD>ste archivo debe ser editado con codificaci¢n CP866
|
||||
|
||||
version db 'Kolibri OS versi¢n 0.7.7.0+ ',13,10,13,10,0
|
||||
diff16 "fin del c¢digo del kernel",0,$
|
@ -1,12 +1,12 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; MEMORY MAP
|
||||
;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;
|
||||
; MEMORY MAP
|
||||
;
|
||||
; Boot:
|
||||
;
|
||||
; 0:9000 byte bits per pixel
|
||||
@ -134,24 +134,24 @@
|
||||
; FE88 dword address of button list
|
||||
; FE8C dword memory to use
|
||||
; FE90 -> FEFF free (112)
|
||||
; FF00 byte 1 = system shutdown request
|
||||
; FF01 byte task activation request?
|
||||
; FFF0 byte >0 if redraw background request from app
|
||||
; FFF1 byte free
|
||||
; FFF2 write and read bank in screen
|
||||
; FFF4 byte 0 if first mouse draw & do not return picture under
|
||||
; FFF5 byte 1 do not draw pointer
|
||||
; FF00 byte 1 = system shutdown request
|
||||
; FF01 byte task activation request?
|
||||
; FFF0 byte >0 if redraw background request from app
|
||||
; FFF1 byte free
|
||||
; FFF2 write and read bank in screen
|
||||
; FFF4 byte 0 if first mouse draw & do not return picture under
|
||||
; FFF5 byte 1 do not draw pointer
|
||||
; FFFF byte do not change task for 1/100 sec.
|
||||
;
|
||||
; 0x80010000 -> 6CBFF kernel, 32-bit run-time code (up to 371 Kb)
|
||||
|
||||
; 0x8006CC00 -> 6DBFF stack at boot time (4Kb)
|
||||
;
|
||||
; 0x8006DC00 -> 6E5FF free (2560)
|
||||
; 0x8006E600 -> 6Efff free (2560)
|
||||
; 0x8006F000 -> 6FFFF main page directory
|
||||
|
||||
; 0x80070000 -> 7FFFF data of retrieved disks and partitions (Mario79)
|
||||
|
||||
; 0x8006CC00 -> 6DBFF stack at boot time (4Kb)
|
||||
;
|
||||
; 0x8006DC00 -> 6E5FF free (2560)
|
||||
; 0x8006E600 -> 6Efff free (2560)
|
||||
; 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
|
||||
;
|
||||
; 00 11db name of app running
|
||||
@ -201,68 +201,68 @@
|
||||
; 0x80280000 -> 281FFF ramdisk fat (8k)
|
||||
; 0x80282000 -> 283FFF floppy fat (8k)
|
||||
;
|
||||
; 0x80284000 -> 28BFFF HDD DMA AREA (32k)
|
||||
; 0x8028C000 -> 297FFF free (48k)
|
||||
;
|
||||
; 0x80298000 -> 29FFFF auxiliary table for background smoothing code (32k)
|
||||
;
|
||||
; 0x802A0000 -> 2B00FF wav device buffer (64k)
|
||||
; 0x802A0000 -> 2B00FF wav device status (256)
|
||||
;
|
||||
; 0x802B0100 -> 2B3FFD free (15k7)
|
||||
;
|
||||
; 0x802B3FEE -> 2B3FEF button info (64K+ 16 + 2 byte)
|
||||
; 2B3FEE 0000 word number of buttons
|
||||
; 2B3FF0 first button entry
|
||||
;
|
||||
; button entry at 0x10
|
||||
; +0000 word process number
|
||||
; +0002 word button id number : bits 00-15
|
||||
; +0004 word x start
|
||||
; 0x80284000 -> 28BFFF HDD DMA AREA (32k)
|
||||
; 0x8028C000 -> 297FFF free (48k)
|
||||
;
|
||||
; 0x80298000 -> 29FFFF auxiliary table for background smoothing code (32k)
|
||||
;
|
||||
; 0x802A0000 -> 2B00FF wav device buffer (64k)
|
||||
; 0x802A0000 -> 2B00FF wav device status (256)
|
||||
;
|
||||
; 0x802B0100 -> 2B3FFD free (15k7)
|
||||
;
|
||||
; 0x802B3FEE -> 2B3FEF button info (64K+ 16 + 2 byte)
|
||||
; 2B3FEE 0000 word number of buttons
|
||||
; 2B3FF0 first button entry
|
||||
;
|
||||
; button entry at 0x10
|
||||
; +0000 word process number
|
||||
; +0002 word button id number : bits 00-15
|
||||
; +0004 word x start
|
||||
; +0006 word x size
|
||||
; +0008 word y start
|
||||
; +000A word y size
|
||||
; +000C word button id number : bits 16-31
|
||||
;
|
||||
; 0x802C4000 -> 2C9FFF area for fast getting offset to LFB (24k)
|
||||
; BPSLine_calc_area
|
||||
; 0x802CA000 -> 2CFFFF area for fast getting offset to _WinMapAddress (24k)
|
||||
; d_width_calc_area
|
||||
;
|
||||
; 0x802D0000 -> 2DFFFF reserved port area (64k)
|
||||
;
|
||||
; +000A word y size
|
||||
; +000C word button id number : bits 16-31
|
||||
;
|
||||
; 0x802C4000 -> 2C9FFF area for fast getting offset to LFB (24k)
|
||||
; BPSLine_calc_area
|
||||
; 0x802CA000 -> 2CFFFF area for fast getting offset to _WinMapAddress (24k)
|
||||
; d_width_calc_area
|
||||
;
|
||||
; 0x802D0000 -> 2DFFFF reserved port area (64k)
|
||||
;
|
||||
; 0000 dword no of port areas reserved
|
||||
; 0010 dword process id
|
||||
; dword start port
|
||||
; dword end port
|
||||
; dword 0
|
||||
;
|
||||
; 0x802E0000 -> 2EFFFF irq data area (64k) ;BOOT_VAR
|
||||
;
|
||||
; 0x802F0000 -> 2F3FFF tcp memory stack_data_start eth_data_start (16k)
|
||||
;
|
||||
; 0x802F4000 -> 30ffff stack_data | stack_data_end (112k)
|
||||
;
|
||||
; 0x80310000 -> 317fff resendQ (32k)
|
||||
;
|
||||
; 0x80318000 -> 31ffff skin_data (32k)
|
||||
;
|
||||
; 0x80320000 -> 323FF3 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
|
||||
;
|
||||
; 0x8032BFF4 -> 32BFFF background info
|
||||
; 0x80323FF4 BgrDrawMode
|
||||
; 0x80323FF8 BgrDataWidth
|
||||
; 0x80323FFC BgrDataHeight
|
||||
;
|
||||
; 0x80324000 page map (length b = memsize shr 15)
|
||||
; 0x80324000 + b start of static pagetables
|
||||
|
||||
; 0x803FFFFF <- no direct address translation beyond this point
|
||||
; =============================================================
|
||||
; dword end port
|
||||
; dword 0
|
||||
;
|
||||
; 0x802E0000 -> 2EFFFF irq data area (64k) ;BOOT_VAR
|
||||
;
|
||||
; 0x802F0000 -> 2F3FFF tcp memory stack_data_start eth_data_start (16k)
|
||||
;
|
||||
; 0x802F4000 -> 30ffff stack_data | stack_data_end (112k)
|
||||
;
|
||||
; 0x80310000 -> 317fff resendQ (32k)
|
||||
;
|
||||
; 0x80318000 -> 31ffff skin_data (32k)
|
||||
;
|
||||
; 0x80320000 -> 323FF3 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
|
||||
;
|
||||
; 0x8032BFF4 -> 32BFFF background info
|
||||
; 0x80323FF4 BgrDrawMode
|
||||
; 0x80323FF8 BgrDataWidth
|
||||
; 0x80323FFC BgrDataHeight
|
||||
;
|
||||
; 0x80324000 page map (length b = memsize shr 15)
|
||||
; 0x80324000 + b start of static pagetables
|
||||
|
||||
; 0x803FFFFF <- no direct address translation beyond this point
|
||||
; =============================================================
|
||||
|
||||
; 0x805FF000 -> 5FFF80 TSS
|
||||
; 0x80600000 -> 601FFF i/o maps
|
||||
|
@ -291,11 +291,15 @@ stack_handler:
|
||||
align 4
|
||||
NET_link_changed:
|
||||
|
||||
ret
|
||||
|
||||
DEBUGF 1,"NET_link_changed: %x\n", ebx
|
||||
|
||||
align 4
|
||||
NET_send_event:
|
||||
|
||||
ret
|
||||
|
||||
DEBUGF 1,"NET_send_event\n"
|
||||
|
||||
; Send event to all applications
|
||||
@ -330,8 +334,7 @@ NET_add_device:
|
||||
|
||||
DEBUGF 1,"NET_Add_Device: %x\n", ebx ;;; TODO: use mutex to lock net device list
|
||||
|
||||
mov eax, [NET_RUNNING]
|
||||
cmp eax, MAX_NET_DEVICES
|
||||
cmp [NET_RUNNING], MAX_NET_DEVICES
|
||||
jae .error
|
||||
|
||||
;----------------------------------
|
||||
|
@ -1,114 +1,114 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
struct BLITTER_BLOCK
|
||||
xmin dd ?
|
||||
ymin dd ?
|
||||
xmax dd ?
|
||||
ymax dd ?
|
||||
ends
|
||||
|
||||
|
||||
struct BLITTER
|
||||
dc RECT
|
||||
sc RECT
|
||||
dst_x dd ? ; 32
|
||||
dst_y dd ? ; 36
|
||||
src_x dd ? ; 40
|
||||
src_y dd ? ; 44
|
||||
w dd ? ; 48
|
||||
h dd ? ; 52
|
||||
|
||||
bitmap dd ? ; 56
|
||||
stride dd ? ; 60
|
||||
ends
|
||||
|
||||
|
||||
|
||||
align 4
|
||||
block_clip:
|
||||
;esi= clip RECT ptr
|
||||
;edi= RECT ptr
|
||||
;return code:
|
||||
;eax= 0 - draw, 1 - don't draw
|
||||
|
||||
push ebx
|
||||
|
||||
mov eax, [edi+RECT.left]
|
||||
mov ebx, [edi+RECT.right]
|
||||
mov ecx, [esi+RECT.left] ;clip.left
|
||||
mov edx, [esi+RECT.right] ;clip.right
|
||||
|
||||
cmp eax, edx ;left >= clip.right
|
||||
jge .fail
|
||||
|
||||
cmp ebx, ecx ;right < clip.left
|
||||
jl .fail
|
||||
|
||||
cmp eax, ecx ;left >= clip.left
|
||||
jae @F
|
||||
|
||||
mov eax, ecx
|
||||
@@:
|
||||
mov [edi+RECT.left], eax
|
||||
|
||||
cmp ebx, edx ;right <= clip.right
|
||||
jle @f
|
||||
mov ebx, edx
|
||||
@@:
|
||||
mov [edi+RECT.right], ebx
|
||||
|
||||
mov eax, [edi+RECT.top]
|
||||
mov ebx, [edi+RECT.bottom]
|
||||
mov ecx, [esi+RECT.top] ;clip.top
|
||||
mov edx, [esi+RECT.bottom] ;clip.bottom
|
||||
|
||||
cmp eax, edx ;top >= clip.bottom
|
||||
jge .fail
|
||||
|
||||
cmp ebx, ecx ;bottom < clip.top
|
||||
jl .fail
|
||||
|
||||
cmp eax, ecx ;top >= clip.top
|
||||
jae @F
|
||||
|
||||
mov eax, ecx
|
||||
@@:
|
||||
mov [edi+RECT.top], eax
|
||||
|
||||
cmp ebx, edx ;bottom <= clip.bottom
|
||||
jle @f
|
||||
mov ebx, edx
|
||||
@@:
|
||||
mov [edi+RECT.bottom], ebx
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
ret
|
||||
.fail:
|
||||
pop ebx
|
||||
mov eax, 1
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
blit_clip:
|
||||
|
||||
.sx0 equ 8
|
||||
.sy0 equ 12
|
||||
.sx1 equ 16
|
||||
.sy1 equ 20
|
||||
|
||||
.dx0 equ 24
|
||||
.dy0 equ 28
|
||||
.dx1 equ 32
|
||||
.dy1 equ 36
|
||||
|
||||
|
||||
push edi
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2011-2012. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
struct BLITTER_BLOCK
|
||||
xmin dd ?
|
||||
ymin dd ?
|
||||
xmax dd ?
|
||||
ymax dd ?
|
||||
ends
|
||||
|
||||
|
||||
struct BLITTER
|
||||
dc RECT
|
||||
sc RECT
|
||||
dst_x dd ? ; 32
|
||||
dst_y dd ? ; 36
|
||||
src_x dd ? ; 40
|
||||
src_y dd ? ; 44
|
||||
w dd ? ; 48
|
||||
h dd ? ; 52
|
||||
|
||||
bitmap dd ? ; 56
|
||||
stride dd ? ; 60
|
||||
ends
|
||||
|
||||
|
||||
|
||||
align 4
|
||||
block_clip:
|
||||
;esi= clip RECT ptr
|
||||
;edi= RECT ptr
|
||||
;return code:
|
||||
;eax= 0 - draw, 1 - don't draw
|
||||
|
||||
push ebx
|
||||
|
||||
mov eax, [edi+RECT.left]
|
||||
mov ebx, [edi+RECT.right]
|
||||
mov ecx, [esi+RECT.left] ;clip.left
|
||||
mov edx, [esi+RECT.right] ;clip.right
|
||||
|
||||
cmp eax, edx ;left >= clip.right
|
||||
jge .fail
|
||||
|
||||
cmp ebx, ecx ;right < clip.left
|
||||
jl .fail
|
||||
|
||||
cmp eax, ecx ;left >= clip.left
|
||||
jae @F
|
||||
|
||||
mov eax, ecx
|
||||
@@:
|
||||
mov [edi+RECT.left], eax
|
||||
|
||||
cmp ebx, edx ;right <= clip.right
|
||||
jle @f
|
||||
mov ebx, edx
|
||||
@@:
|
||||
mov [edi+RECT.right], ebx
|
||||
|
||||
mov eax, [edi+RECT.top]
|
||||
mov ebx, [edi+RECT.bottom]
|
||||
mov ecx, [esi+RECT.top] ;clip.top
|
||||
mov edx, [esi+RECT.bottom] ;clip.bottom
|
||||
|
||||
cmp eax, edx ;top >= clip.bottom
|
||||
jge .fail
|
||||
|
||||
cmp ebx, ecx ;bottom < clip.top
|
||||
jl .fail
|
||||
|
||||
cmp eax, ecx ;top >= clip.top
|
||||
jae @F
|
||||
|
||||
mov eax, ecx
|
||||
@@:
|
||||
mov [edi+RECT.top], eax
|
||||
|
||||
cmp ebx, edx ;bottom <= clip.bottom
|
||||
jle @f
|
||||
mov ebx, edx
|
||||
@@:
|
||||
mov [edi+RECT.bottom], ebx
|
||||
pop ebx
|
||||
xor eax, eax
|
||||
ret
|
||||
.fail:
|
||||
pop ebx
|
||||
mov eax, 1
|
||||
ret
|
||||
|
||||
|
||||
align 4
|
||||
blit_clip:
|
||||
|
||||
.sx0 equ 8
|
||||
.sy0 equ 12
|
||||
.sx1 equ 16
|
||||
.sy1 equ 20
|
||||
|
||||
.dx0 equ 24
|
||||
.dy0 equ 28
|
||||
.dx1 equ 32
|
||||
.dy1 equ 36
|
||||
|
||||
|
||||
push edi
|
||||
push esi
|
||||
push ebx
|
||||
sub esp, 40
|
||||
@ -116,58 +116,58 @@ blit_clip:
|
||||
mov ebx, ecx
|
||||
mov edx, [ecx+BLITTER.src_x]
|
||||
mov [esp+.sx0], edx
|
||||
mov eax, [ecx+BLITTER.src_y]
|
||||
mov [esp+.sy0], eax
|
||||
add edx, [ecx+BLITTER.w]
|
||||
add eax, [ecx+BLITTER.h]
|
||||
mov [esp+.sx1], edx
|
||||
mov [esp+.sy1], eax
|
||||
|
||||
lea edi, [esp+.sx0]
|
||||
lea esi, [ebx+BLITTER.sc]
|
||||
|
||||
call block_clip
|
||||
test eax, eax
|
||||
mov esi, 1
|
||||
jnz .done
|
||||
|
||||
mov edi, [esp+.sx0]
|
||||
mov edx, [ebx+BLITTER.dst_x]
|
||||
mov eax, [ecx+BLITTER.src_y]
|
||||
mov [esp+.sy0], eax
|
||||
add edx, [ecx+BLITTER.w]
|
||||
add eax, [ecx+BLITTER.h]
|
||||
mov [esp+.sx1], edx
|
||||
mov [esp+.sy1], eax
|
||||
|
||||
lea edi, [esp+.sx0]
|
||||
lea esi, [ebx+BLITTER.sc]
|
||||
|
||||
call block_clip
|
||||
test eax, eax
|
||||
mov esi, 1
|
||||
jnz .done
|
||||
|
||||
mov edi, [esp+.sx0]
|
||||
mov edx, [ebx+BLITTER.dst_x]
|
||||
add edx, edi
|
||||
sub edx, [ebx+BLITTER.src_x]
|
||||
mov [esp+.dx0], edx
|
||||
|
||||
mov ecx, [esp+.sy0]
|
||||
mov eax, [ebx+BLITTER.dst_y]
|
||||
add eax, ecx
|
||||
sub eax, [ebx+BLITTER.src_y]
|
||||
mov [esp+.dy0], eax
|
||||
|
||||
sub edx, edi
|
||||
add edx, [esp+.sx1]
|
||||
mov [esp+.dx1], edx
|
||||
add eax, ecx
|
||||
sub eax, [ebx+BLITTER.src_y]
|
||||
mov [esp+.dy0], eax
|
||||
|
||||
sub edx, edi
|
||||
add edx, [esp+.sx1]
|
||||
mov [esp+.dx1], edx
|
||||
|
||||
sub eax, ecx
|
||||
add eax, [esp+.sy1]
|
||||
mov [esp+.dy1], eax
|
||||
|
||||
lea edi, [esp+.dx0]
|
||||
lea esi, [ebx+BLITTER.dc]
|
||||
call block_clip
|
||||
test eax, eax
|
||||
mov esi, 1
|
||||
jnz .done
|
||||
|
||||
mov edx, [esp+.dx0]
|
||||
mov eax, [esp+.dx1]
|
||||
sub eax, edx
|
||||
mov [ebx+BLITTER.w], eax
|
||||
|
||||
mov eax, [esp+.dy0]
|
||||
mov ecx, [esp+.dy1]
|
||||
sub ecx, eax
|
||||
mov [ebx+BLITTER.h], ecx
|
||||
|
||||
add eax, [esp+.sy1]
|
||||
mov [esp+.dy1], eax
|
||||
|
||||
lea edi, [esp+.dx0]
|
||||
lea esi, [ebx+BLITTER.dc]
|
||||
call block_clip
|
||||
test eax, eax
|
||||
mov esi, 1
|
||||
jnz .done
|
||||
|
||||
mov edx, [esp+.dx0]
|
||||
mov eax, [esp+.dx1]
|
||||
sub eax, edx
|
||||
mov [ebx+BLITTER.w], eax
|
||||
|
||||
mov eax, [esp+.dy0]
|
||||
mov ecx, [esp+.dy1]
|
||||
sub ecx, eax
|
||||
mov [ebx+BLITTER.h], ecx
|
||||
|
||||
mov ecx, [ebx+BLITTER.src_x]
|
||||
add ecx, edx
|
||||
sub ecx, [ebx+BLITTER.dst_x]
|
||||
@ -177,13 +177,13 @@ blit_clip:
|
||||
add ecx, eax
|
||||
sub ecx, [ebx+BLITTER.dst_y]
|
||||
mov [ebx+BLITTER.src_y], ecx
|
||||
mov [ebx+BLITTER.dst_x], edx
|
||||
mov [ebx+BLITTER.dst_y], eax
|
||||
xor esi, esi
|
||||
.done:
|
||||
mov eax, esi
|
||||
add esp, 40
|
||||
pop ebx
|
||||
mov [ebx+BLITTER.dst_x], edx
|
||||
mov [ebx+BLITTER.dst_y], eax
|
||||
xor esi, esi
|
||||
.done:
|
||||
mov eax, esi
|
||||
add esp, 40
|
||||
pop ebx
|
||||
pop esi
|
||||
pop edi
|
||||
|
||||
@ -197,42 +197,42 @@ purge .dx0
|
||||
purge .dy0
|
||||
purge .dx1
|
||||
purge .dy1
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
blit_32:
|
||||
push ebp
|
||||
push edi
|
||||
|
||||
ret
|
||||
|
||||
align 4
|
||||
blit_32:
|
||||
push ebp
|
||||
push edi
|
||||
push esi
|
||||
push ebx
|
||||
sub esp, 72
|
||||
|
||||
mov eax, [TASK_BASE]
|
||||
mov ebx, [eax-twdw + WDATA.box.width]
|
||||
mov edx, [eax-twdw + WDATA.box.height]
|
||||
inc ebx
|
||||
inc edx
|
||||
|
||||
xor eax, eax
|
||||
|
||||
mov [esp+BLITTER.dc.left], eax
|
||||
mov [esp+BLITTER.dc.top], eax
|
||||
mov [esp+BLITTER.dc.right], ebx
|
||||
mov [esp+BLITTER.dc.bottom], edx
|
||||
|
||||
mov [esp+BLITTER.sc.left], eax
|
||||
mov [esp+BLITTER.sc.top], eax
|
||||
mov eax, [ecx+24]
|
||||
|
||||
mov [esp+BLITTER.sc.right], eax
|
||||
mov eax, [ecx+28]
|
||||
|
||||
mov [esp+BLITTER.sc.bottom], eax
|
||||
|
||||
mov eax, [ecx]
|
||||
mov [esp+BLITTER.dst_x], eax
|
||||
mov eax, [ecx+4]
|
||||
mov eax, [TASK_BASE]
|
||||
mov ebx, [eax-twdw + WDATA.box.width]
|
||||
mov edx, [eax-twdw + WDATA.box.height]
|
||||
inc ebx
|
||||
inc edx
|
||||
|
||||
xor eax, eax
|
||||
|
||||
mov [esp+BLITTER.dc.left], eax
|
||||
mov [esp+BLITTER.dc.top], eax
|
||||
mov [esp+BLITTER.dc.right], ebx
|
||||
mov [esp+BLITTER.dc.bottom], edx
|
||||
|
||||
mov [esp+BLITTER.sc.left], eax
|
||||
mov [esp+BLITTER.sc.top], eax
|
||||
mov eax, [ecx+24]
|
||||
|
||||
mov [esp+BLITTER.sc.right], eax
|
||||
mov eax, [ecx+28]
|
||||
|
||||
mov [esp+BLITTER.sc.bottom], eax
|
||||
|
||||
mov eax, [ecx]
|
||||
mov [esp+BLITTER.dst_x], eax
|
||||
mov eax, [ecx+4]
|
||||
mov [esp+BLITTER.dst_y], eax
|
||||
|
||||
mov eax, [ecx+16]
|
||||
@ -252,42 +252,42 @@ blit_32:
|
||||
|
||||
mov ecx, esp
|
||||
call blit_clip
|
||||
test eax, eax
|
||||
jne .L57
|
||||
|
||||
mov eax, [TASK_BASE]
|
||||
|
||||
mov ebx, [esp+BLITTER.dst_x]
|
||||
mov ebp, [esp+BLITTER.dst_y]
|
||||
add ebx, [eax-twdw + WDATA.box.left]
|
||||
add ebp, [eax-twdw + WDATA.box.top]
|
||||
|
||||
mov ecx, ebx
|
||||
add ecx, [esp+BLITTER.w]
|
||||
shl ecx, 16
|
||||
mov cx, bp
|
||||
add ecx, [esp+BLITTER.h]
|
||||
|
||||
mov edi, ebp
|
||||
|
||||
; imul edi, [_display.pitch]
|
||||
mov edi, [BPSLine_calc_area+edi*4]
|
||||
; imul ebp, [_display.width]
|
||||
mov ebp, [d_width_calc_area+ebp*4]
|
||||
|
||||
add ebp, ebx
|
||||
add ebp, [_WinMapAddress]
|
||||
|
||||
test eax, eax
|
||||
jne .L57
|
||||
|
||||
mov eax, [TASK_BASE]
|
||||
|
||||
mov ebx, [esp+BLITTER.dst_x]
|
||||
mov ebp, [esp+BLITTER.dst_y]
|
||||
add ebx, [eax-twdw + WDATA.box.left]
|
||||
add ebp, [eax-twdw + WDATA.box.top]
|
||||
|
||||
mov ecx, ebx
|
||||
add ecx, [esp+BLITTER.w]
|
||||
shl ecx, 16
|
||||
mov cx, bp
|
||||
add ecx, [esp+BLITTER.h]
|
||||
|
||||
mov edi, ebp
|
||||
|
||||
; imul edi, [_display.pitch]
|
||||
mov edi, [BPSLine_calc_area+edi*4]
|
||||
; imul ebp, [_display.width]
|
||||
mov ebp, [d_width_calc_area+ebp*4]
|
||||
|
||||
add ebp, ebx
|
||||
add ebp, [_WinMapAddress]
|
||||
|
||||
mov eax, [esp+BLITTER.src_y]
|
||||
imul eax, [esp+BLITTER.stride]
|
||||
mov esi, [esp+BLITTER.src_x]
|
||||
lea esi, [eax+esi*4]
|
||||
add esi, [esp+BLITTER.bitmap]
|
||||
|
||||
mov eax, ecx
|
||||
mov ecx, [esp+BLITTER.h]
|
||||
mov edx, [esp+BLITTER.w]
|
||||
|
||||
lea esi, [eax+esi*4]
|
||||
add esi, [esp+BLITTER.bitmap]
|
||||
|
||||
mov eax, ecx
|
||||
mov ecx, [esp+BLITTER.h]
|
||||
mov edx, [esp+BLITTER.w]
|
||||
|
||||
test ecx, ecx ;FIXME check clipping
|
||||
jz .L57
|
||||
|
||||
@ -297,52 +297,52 @@ blit_32:
|
||||
cmp [_display.bpp], 32
|
||||
jne .core_24
|
||||
|
||||
lea edi, [edi+ebx*4]
|
||||
|
||||
mov ebx, [CURRENT_TASK]
|
||||
align 4
|
||||
.outer32:
|
||||
xor ecx, ecx
|
||||
lea edi, [edi+ebx*4]
|
||||
|
||||
align 4
|
||||
.inner32:
|
||||
cmp [ebp+ecx], bl
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push eax
|
||||
mov eax, [esi+ecx*4]
|
||||
|
||||
; check for hardware cursor
|
||||
cmp [_display.select_cursor], select_cursor
|
||||
je @f
|
||||
cmp [_display.select_cursor], 0
|
||||
jne .no_mouseunder
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
push ecx
|
||||
|
||||
mov ecx, [esp+4]
|
||||
ror ecx, 16
|
||||
sub ecx, edx
|
||||
rol ecx, 16
|
||||
sub ecx, [esp+BLITTER.h + 8]
|
||||
|
||||
; check mouse area for putpixel
|
||||
call [_display.check_mouse]
|
||||
pop ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouseunder:
|
||||
; store to real LFB
|
||||
mov [LFB_BASE+edi+ecx*4], eax
|
||||
pop eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.skip:
|
||||
inc ecx
|
||||
dec edx
|
||||
jnz .inner32
|
||||
mov ebx, [CURRENT_TASK]
|
||||
align 4
|
||||
.outer32:
|
||||
xor ecx, ecx
|
||||
|
||||
align 4
|
||||
.inner32:
|
||||
cmp [ebp+ecx], bl
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push eax
|
||||
mov eax, [esi+ecx*4]
|
||||
|
||||
; check for hardware cursor
|
||||
cmp [_display.select_cursor], select_cursor
|
||||
je @f
|
||||
cmp [_display.select_cursor], 0
|
||||
jne .no_mouseunder
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
push ecx
|
||||
|
||||
mov ecx, [esp+4]
|
||||
ror ecx, 16
|
||||
sub ecx, edx
|
||||
rol ecx, 16
|
||||
sub ecx, [esp+BLITTER.h + 8]
|
||||
|
||||
; check mouse area for putpixel
|
||||
call [_display.check_mouse]
|
||||
pop ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouseunder:
|
||||
; store to real LFB
|
||||
mov [LFB_BASE+edi+ecx*4], eax
|
||||
pop eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.skip:
|
||||
inc ecx
|
||||
dec edx
|
||||
jnz .inner32
|
||||
|
||||
add esi, [esp+BLITTER.stride]
|
||||
add edi, [_display.pitch]
|
||||
@ -350,14 +350,14 @@ align 4
|
||||
|
||||
mov edx, [esp+BLITTER.w]
|
||||
dec [esp+BLITTER.h]
|
||||
jnz .outer32
|
||||
|
||||
.done:
|
||||
; call [draw_pointer]
|
||||
; call __sys_draw_pointer
|
||||
.L57:
|
||||
add esp, 72
|
||||
pop ebx
|
||||
jnz .outer32
|
||||
|
||||
.done:
|
||||
; call [draw_pointer]
|
||||
; call __sys_draw_pointer
|
||||
.L57:
|
||||
add esp, 72
|
||||
pop ebx
|
||||
pop esi
|
||||
pop edi
|
||||
pop ebp
|
||||
@ -373,49 +373,49 @@ align 4
|
||||
mov [esp+64], edi
|
||||
xor ecx, ecx
|
||||
|
||||
align 4
|
||||
.inner24:
|
||||
cmp [ebp+ecx], bl
|
||||
jne .skip_1
|
||||
;--------------------------------------
|
||||
push eax
|
||||
mov eax, [esi+ecx*4]
|
||||
|
||||
lea edi, [edi+ecx*2]
|
||||
|
||||
; check for hardware cursor
|
||||
cmp [_display.select_cursor], select_cursor
|
||||
je @f
|
||||
cmp [_display.select_cursor], 0
|
||||
jne .no_mouseunder_1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
push ecx
|
||||
|
||||
mov ecx, [esp+4]
|
||||
ror ecx, 16
|
||||
sub ecx, edx
|
||||
rol ecx, 16
|
||||
sub ecx, [esp+BLITTER.h + 8]
|
||||
|
||||
; check mouse area for putpixel
|
||||
call [_display.check_mouse]
|
||||
pop ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouseunder_1:
|
||||
mov [edi+ecx], ax
|
||||
shr eax, 16
|
||||
mov [edi+ecx+2], al
|
||||
|
||||
pop eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.skip_1:
|
||||
mov edi, [esp+64]
|
||||
inc ecx
|
||||
dec edx
|
||||
align 4
|
||||
.inner24:
|
||||
cmp [ebp+ecx], bl
|
||||
jne .skip_1
|
||||
;--------------------------------------
|
||||
push eax
|
||||
mov eax, [esi+ecx*4]
|
||||
|
||||
lea edi, [edi+ecx*2]
|
||||
|
||||
; check for hardware cursor
|
||||
cmp [_display.select_cursor], select_cursor
|
||||
je @f
|
||||
cmp [_display.select_cursor], 0
|
||||
jne .no_mouseunder_1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
push ecx
|
||||
|
||||
mov ecx, [esp+4]
|
||||
ror ecx, 16
|
||||
sub ecx, edx
|
||||
rol ecx, 16
|
||||
sub ecx, [esp+BLITTER.h + 8]
|
||||
|
||||
; check mouse area for putpixel
|
||||
call [_display.check_mouse]
|
||||
pop ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouseunder_1:
|
||||
mov [edi+ecx], ax
|
||||
shr eax, 16
|
||||
mov [edi+ecx+2], al
|
||||
|
||||
pop eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.skip_1:
|
||||
mov edi, [esp+64]
|
||||
inc ecx
|
||||
dec edx
|
||||
jnz .inner24
|
||||
|
||||
add esi, [esp+BLITTER.stride]
|
||||
|
@ -444,17 +444,17 @@ align 4
|
||||
.fail2:
|
||||
ret
|
||||
endp
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
proc delete_cursor stdcall, hcursor:dword
|
||||
|
||||
; DEBUGF 1,'K : delete_cursor %x\n', [hcursor]
|
||||
|
||||
mov esi, [hcursor]
|
||||
|
||||
cmp [esi+CURSOR.magic], 'CURS'
|
||||
jne .fail
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
align 4
|
||||
proc delete_cursor stdcall, hcursor:dword
|
||||
|
||||
; DEBUGF 1,'K : delete_cursor %x\n', [hcursor]
|
||||
|
||||
mov esi, [hcursor]
|
||||
|
||||
cmp [esi+CURSOR.magic], 'CURS'
|
||||
jne .fail
|
||||
|
||||
mov ebx, [CURRENT_TASK]
|
||||
shl ebx, 5
|
||||
mov ebx, [CURRENT_TASK+ebx+4]
|
||||
@ -634,14 +634,14 @@ align 4
|
||||
mov [cur.bottom], edi
|
||||
|
||||
sub ebx, [x]
|
||||
sub edi, [y]
|
||||
inc ebx
|
||||
inc edi
|
||||
sub ebx, [_dx]
|
||||
sub edi, [_dy]
|
||||
|
||||
mov [cur.w], ebx
|
||||
mov [cur.h], edi
|
||||
sub edi, [y]
|
||||
inc ebx
|
||||
inc edi
|
||||
sub ebx, [_dx]
|
||||
sub edi, [_dy]
|
||||
|
||||
mov [cur.w], ebx
|
||||
mov [cur.h], edi
|
||||
mov [h], edi
|
||||
|
||||
mov eax, edi
|
||||
@ -752,14 +752,14 @@ align 4
|
||||
mov [cur.bottom], edi
|
||||
|
||||
sub ebx, [x]
|
||||
sub edi, [y]
|
||||
inc ebx
|
||||
inc edi
|
||||
sub ebx, [_dx]
|
||||
sub edi, [_dy]
|
||||
|
||||
mov [cur.w], ebx
|
||||
mov [cur.h], edi
|
||||
sub edi, [y]
|
||||
inc ebx
|
||||
inc edi
|
||||
sub ebx, [_dx]
|
||||
sub edi, [_dy]
|
||||
|
||||
mov [cur.w], ebx
|
||||
mov [cur.h], edi
|
||||
mov [h], edi
|
||||
|
||||
mov eax, edi
|
||||
@ -831,16 +831,16 @@ check_mouse_area_for_getpixel_new:
|
||||
|
||||
cmp ax, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
;--------------------------------------
|
||||
push eax ebx
|
||||
; offset X
|
||||
movzx ecx, word [X_UNDER_subtraction_CUR_hot_x]
|
||||
sub eax, ecx ; x1
|
||||
; offset Y
|
||||
movzx ecx, word [Y_UNDER_subtraction_CUR_hot_y]
|
||||
sub ebx, ecx ; y1
|
||||
;--------------------------------------
|
||||
; ebx = offset y
|
||||
;--------------------------------------
|
||||
push eax ebx
|
||||
; offset X
|
||||
movzx ecx, word [X_UNDER_subtraction_CUR_hot_x]
|
||||
sub eax, ecx ; x1
|
||||
; offset Y
|
||||
movzx ecx, word [Y_UNDER_subtraction_CUR_hot_y]
|
||||
sub ebx, ecx ; y1
|
||||
;--------------------------------------
|
||||
; ebx = offset y
|
||||
; eax = offset x
|
||||
imul ebx, [cur.w] ;y
|
||||
add eax, ebx
|
||||
@ -870,55 +870,55 @@ check_mouse_area_for_putpixel_new:
|
||||
; ecx = x shl 16 + y
|
||||
; eax = color
|
||||
; out:
|
||||
; eax = new color
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.1:
|
||||
push eax
|
||||
;--------------------------------------
|
||||
; ecx = (offset x) shl 16 + (offset y)
|
||||
push ebx
|
||||
mov ebx, ecx
|
||||
shr ebx, 16 ; x
|
||||
and ecx, 0xffff ; y
|
||||
|
||||
cmp ecx, [cur.h]
|
||||
jae @f
|
||||
|
||||
cmp ebx, [cur.w]
|
||||
jb .ok
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; DEBUGF 1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx
|
||||
pop ebx
|
||||
jmp .sh ; SORRY! SHIT HAPPENS!
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ok:
|
||||
; ecx = offset y
|
||||
; ebx = offset x
|
||||
push ebx ecx
|
||||
imul ecx, [cur.w] ;y
|
||||
add ecx, ebx
|
||||
; eax = new color
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.1:
|
||||
push eax
|
||||
;--------------------------------------
|
||||
; ecx = (offset x) shl 16 + (offset y)
|
||||
push ebx
|
||||
mov ebx, ecx
|
||||
shr ebx, 16 ; x
|
||||
and ecx, 0xffff ; y
|
||||
|
||||
cmp ecx, [cur.h]
|
||||
jae @f
|
||||
|
||||
cmp ebx, [cur.w]
|
||||
jb .ok
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; DEBUGF 1, "K : SHIT HAPPENS: %x %x \n", ecx,ebx
|
||||
pop ebx
|
||||
jmp .sh ; SORRY! SHIT HAPPENS!
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.ok:
|
||||
; ecx = offset y
|
||||
; ebx = offset x
|
||||
push ebx ecx
|
||||
imul ecx, [cur.w] ;y
|
||||
add ecx, ebx
|
||||
mov ebx, ecx
|
||||
shl ecx, 2
|
||||
cmp [ScreenBPP], byte 24
|
||||
@ -948,20 +948,20 @@ align 4
|
||||
|
||||
pop ebx
|
||||
|
||||
test eax, 0xFF000000
|
||||
jz @f
|
||||
|
||||
add esp, 4
|
||||
ret
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
mov ecx, -1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop eax
|
||||
;--------------------------------------
|
||||
test eax, 0xFF000000
|
||||
jz @f
|
||||
|
||||
add esp, 4
|
||||
ret
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
mov ecx, -1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
pop eax
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouse_area:
|
||||
ret
|
||||
|
@ -1,9 +1,9 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; VESA12.INC ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;; VESA12.INC ;;
|
||||
;; ;;
|
||||
;; Vesa 1.2 functions for MenuetOS ;;
|
||||
;; ;;
|
||||
|
@ -403,44 +403,44 @@ align 4
|
||||
mov eax, [putimg.ebp+4]
|
||||
call eax
|
||||
cmp [ebp], bl
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
neg ecx
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
shl ecx, 16
|
||||
|
||||
add ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
cmp ecx, -1 ;SHIT HAPPENS?
|
||||
jne .no_mouse_area
|
||||
|
||||
mov ecx, [esp]
|
||||
jmp .sh
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouse_area:
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
neg ecx
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
shl ecx, 16
|
||||
|
||||
add ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
cmp ecx, -1 ;SHIT HAPPENS?
|
||||
jne .no_mouse_area
|
||||
|
||||
mov ecx, [esp]
|
||||
jmp .sh
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouse_area:
|
||||
pop ecx
|
||||
; store to real LFB
|
||||
mov [LFB_BASE+edx], ax
|
||||
@ -614,44 +614,44 @@ align 4
|
||||
mov eax, [putimg.ebp+4]
|
||||
call eax
|
||||
cmp [ebp], bl
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
neg ecx
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
shl ecx, 16
|
||||
|
||||
add ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
cmp ecx, -1 ;SHIT HAPPENS?
|
||||
jne .no_mouse_area
|
||||
|
||||
mov ecx, [esp]
|
||||
jmp .sh
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouse_area:
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
push ecx
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.sh:
|
||||
neg ecx
|
||||
add ecx, [putimg.real_sx_and_abs_cx + 4]
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
shl ecx, 16
|
||||
|
||||
add ecx, [putimg.real_sy_and_abs_cy + 4]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
cmp ecx, -1 ;SHIT HAPPENS?
|
||||
jne .no_mouse_area
|
||||
|
||||
mov ecx, [esp]
|
||||
jmp .sh
|
||||
;--------------------------------------
|
||||
align 4
|
||||
.no_mouse_area:
|
||||
pop ecx
|
||||
; store to real LFB
|
||||
mov [LFB_BASE+edx], eax
|
||||
@ -782,29 +782,29 @@ Vesa20_putpixel24_new:
|
||||
jne @f
|
||||
; check mouse area for putpixel
|
||||
test eax, 0x04000000
|
||||
jnz @f
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
ror ecx, 16
|
||||
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
jnz @f
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
ror ecx, 16
|
||||
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
; store to real LFB
|
||||
mov [LFB_BASE+ebx+edi], ax
|
||||
@ -858,29 +858,29 @@ Vesa20_putpixel32_new:
|
||||
jne @f
|
||||
; check mouse area for putpixel
|
||||
test eax, 0x04000000
|
||||
jnz @f
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
ror ecx, 16
|
||||
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
jnz @f
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb @f
|
||||
|
||||
rol ecx, 16
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae @f
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb @f
|
||||
|
||||
ror ecx, 16
|
||||
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
;--------------------------------------
|
||||
align 4
|
||||
@@:
|
||||
and eax, 0xffffff
|
||||
; store to real LFB
|
||||
@ -1391,30 +1391,30 @@ align 4
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
mov ecx, [drbar.real_sy_and_abs_cy]
|
||||
sub ecx, esi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
add ecx, [drbar.real_sx_and_abs_cx]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
push eax
|
||||
sub ecx, esi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
add ecx, [drbar.real_sx_and_abs_cx]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
push eax
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
mov [edx], ax
|
||||
shr eax, 16
|
||||
@ -1578,30 +1578,30 @@ align 4
|
||||
jne .skip
|
||||
;--------------------------------------
|
||||
mov ecx, [drbar.real_sy_and_abs_cy]
|
||||
sub ecx, esi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
add ecx, [drbar.real_sx_and_abs_cx]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
push eax
|
||||
sub ecx, esi
|
||||
;--------------------------------------
|
||||
; check for Y
|
||||
cmp cx, [Y_UNDER_sub_CUR_hot_y_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [Y_UNDER_subtraction_CUR_hot_y]
|
||||
jb .no_mouse_area
|
||||
|
||||
rol ecx, 16
|
||||
add ecx, [drbar.real_sx_and_abs_cx]
|
||||
sub ecx, edi
|
||||
;--------------------------------------
|
||||
; check for X
|
||||
cmp cx, [X_UNDER_sub_CUR_hot_x_add_curh]
|
||||
jae .no_mouse_area
|
||||
|
||||
sub cx, [X_UNDER_subtraction_CUR_hot_x]
|
||||
jb .no_mouse_area
|
||||
|
||||
ror ecx, 16
|
||||
;--------------------------------------
|
||||
; check mouse area for putpixel
|
||||
push eax
|
||||
call check_mouse_area_for_putpixel_new.1
|
||||
mov [edx], eax
|
||||
pop eax
|
||||
|
@ -1,58 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
|
||||
|
||||
;
|
||||
; Call of videomode driver's functions
|
||||
;
|
||||
; (Add in System function 21 (and/or 26) as a subfunction 13)
|
||||
;
|
||||
; Author: Trans
|
||||
; Date: 19.07.2003
|
||||
;
|
||||
; Include in MeOS kernel and compile with FASM
|
||||
;
|
||||
|
||||
uglobal
|
||||
old_screen_width dd ?
|
||||
old_screen_height dd ?
|
||||
endg
|
||||
|
||||
; cmp eax,13 ; CALL VIDEOMODE DRIVER FUNCTIONS
|
||||
dec ebx
|
||||
jnz .no_vmode_drv_access
|
||||
pushd [Screen_Max_X] [Screen_Max_Y]
|
||||
popd [old_screen_height] [old_screen_width]
|
||||
or eax,-1 ; If driver is absent then eax does not change
|
||||
call (VMODE_BASE+0x100) ; Entry point of video driver
|
||||
mov [esp+36-4],eax
|
||||
mov [esp+24-4],ebx
|
||||
mov [esp+32-4],ecx
|
||||
; mov [esp+28],edx
|
||||
mov eax,[old_screen_width]
|
||||
mov ebx,[old_screen_height]
|
||||
sub eax,[Screen_Max_X]
|
||||
jnz @f
|
||||
sub ebx,[Screen_Max_Y]
|
||||
jz .resolution_wasnt_changed
|
||||
jmp .lp1
|
||||
@@: sub ebx,[Screen_Max_Y]
|
||||
.lp1: sub [screen_workarea.right],eax
|
||||
sub [screen_workarea.bottom],ebx
|
||||
|
||||
call repos_windows
|
||||
xor eax,eax
|
||||
xor ebx,ebx
|
||||
mov ecx, [Screen_Max_X]
|
||||
mov edx, [Screen_Max_Y]
|
||||
call calculatescreen
|
||||
|
||||
.resolution_wasnt_changed:
|
||||
ret
|
||||
.no_vmode_drv_access:
|
@ -1,35 +0,0 @@
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; ;;
|
||||
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
|
||||
;; Distributed under terms of the GNU General Public License ;;
|
||||
;; ;;
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
$Revision$
|
||||
|
||||
|
||||
;
|
||||
; Load of videomode driver in memory
|
||||
;
|
||||
; (driver is located at VMODE_BASE - 32kb) // if this area not occuped anything
|
||||
;
|
||||
; Author: Trans
|
||||
; Date: 19.07.2003
|
||||
;
|
||||
; Include in MeOS kernel and compile with FASM
|
||||
;
|
||||
|
||||
|
||||
; LOAD VIDEOMODE DRIVER
|
||||
; If vmode.mdr file not found
|
||||
or eax,-1 ; Driver ID = -1 (not present in system)
|
||||
mov [VMODE_BASE],eax ;
|
||||
mov [VMODE_BASE+0x100],byte 0xC3 ; Instruction RETN - driver loop
|
||||
|
||||
stdcall read_file, vmode, VMODE_BASE, 0, 0x8000 ;{SPraid.simba}
|
||||
; mov esi, vmode
|
||||
; xor ebx, ebx
|
||||
; mov ecx, 0x8000 ; size of memory area for driver
|
||||
; mov edx, VMODE_BASE ; Memory position of driver
|
||||
; xor ebp, ebp
|
||||
; call fs_RamdiskRead
|
Loading…
Reference in New Issue
Block a user