From 0c4f694a812e4c32ad6fd8a1d8882f0e718fc7dc Mon Sep 17 00:00:00 2001 From: "Sergey Semyonov (Serge)" Date: Mon, 1 Jun 2015 19:18:07 +0000 Subject: [PATCH] update git-svn-id: svn://kolibrios.org@5565 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../branches/Kolibri-acpi/blkdev/bd_drv.inc | 2 +- .../branches/Kolibri-acpi/blkdev/cd_drv.inc | 2 +- kernel/branches/Kolibri-acpi/blkdev/disk.inc | 2 +- .../Kolibri-acpi/blkdev/disk_cache.inc | 2 +- kernel/branches/Kolibri-acpi/blkdev/fdc.inc | 2 +- .../branches/Kolibri-acpi/blkdev/flp_drv.inc | 2 +- .../branches/Kolibri-acpi/blkdev/hd_drv.inc | 2 +- .../Kolibri-acpi/blkdev/ide_cache.inc | 2 +- kernel/branches/Kolibri-acpi/blkdev/rd.inc | 2 +- .../branches/Kolibri-acpi/blkdev/rdsave.inc | 2 +- .../branches/Kolibri-acpi/boot/bootcode.inc | 2 +- kernel/branches/Kolibri-acpi/boot/booten.inc | 2 +- kernel/branches/Kolibri-acpi/boot/bootet.inc | 2 +- kernel/branches/Kolibri-acpi/boot/bootge.inc | 2 +- kernel/branches/Kolibri-acpi/boot/bootru.inc | 2 +- kernel/branches/Kolibri-acpi/boot/bootsp.inc | 2 +- kernel/branches/Kolibri-acpi/boot/bootstr.inc | 2 +- .../branches/Kolibri-acpi/boot/bootvesa.inc | 4 +- kernel/branches/Kolibri-acpi/boot/et.inc | 2 +- kernel/branches/Kolibri-acpi/boot/parsers.inc | 2 +- kernel/branches/Kolibri-acpi/boot/preboot.inc | 2 +- kernel/branches/Kolibri-acpi/boot/rdload.inc | 2 +- kernel/branches/Kolibri-acpi/boot/ru.inc | 2 +- .../branches/Kolibri-acpi/boot/shutdown.inc | 2 +- .../Kolibri-acpi/bootloader/boot_fat12.asm | 2 +- .../Kolibri-acpi/bootloader/floppy1440.inc | 2 +- .../Kolibri-acpi/bootloader/floppy1680.inc | 2 +- .../Kolibri-acpi/bootloader/floppy1743.inc | 2 +- .../Kolibri-acpi/bootloader/floppy2880.inc | 2 +- kernel/branches/Kolibri-acpi/bus/pci/PCIe.inc | 2 +- .../branches/Kolibri-acpi/bus/pci/pci16.inc | 2 +- .../branches/Kolibri-acpi/bus/pci/pci32.inc | 2 +- .../Kolibri-acpi/bus/usb/hccommon.inc | 2 +- kernel/branches/Kolibri-acpi/bus/usb/hub.inc | 4 +- kernel/branches/Kolibri-acpi/bus/usb/init.inc | 4 +- .../branches/Kolibri-acpi/bus/usb/memory.inc | 4 +- kernel/branches/Kolibri-acpi/bus/usb/pipe.inc | 4 +- .../Kolibri-acpi/bus/usb/protocol.inc | 4 +- kernel/branches/Kolibri-acpi/const.inc | 116 +++++++---- kernel/branches/Kolibri-acpi/core/apic.inc | 6 +- .../branches/Kolibri-acpi/core/clipboard.inc | 2 +- .../Kolibri-acpi/core/conf_lib-sp.inc | 2 +- .../branches/Kolibri-acpi/core/conf_lib.inc | 2 +- kernel/branches/Kolibri-acpi/core/debug.inc | 2 +- kernel/branches/Kolibri-acpi/core/dll.inc | 8 +- kernel/branches/Kolibri-acpi/core/export.inc | 2 +- kernel/branches/Kolibri-acpi/core/exports.inc | 11 +- kernel/branches/Kolibri-acpi/core/ext_lib.inc | 2 +- kernel/branches/Kolibri-acpi/core/fpu.inc | 2 +- kernel/branches/Kolibri-acpi/core/heap.inc | 10 +- kernel/branches/Kolibri-acpi/core/irq.inc | 2 +- kernel/branches/Kolibri-acpi/core/malloc.inc | 2 +- kernel/branches/Kolibri-acpi/core/memory.inc | 49 ++--- kernel/branches/Kolibri-acpi/core/mtrr.inc | 65 +++++- kernel/branches/Kolibri-acpi/core/peload.inc | 3 +- kernel/branches/Kolibri-acpi/core/sched.inc | 187 +++++++++++++++-- kernel/branches/Kolibri-acpi/core/string.inc | 2 +- kernel/branches/Kolibri-acpi/core/sync.inc | 2 +- .../branches/Kolibri-acpi/core/sys32-sp.inc | 2 +- kernel/branches/Kolibri-acpi/core/sys32.inc | 4 +- kernel/branches/Kolibri-acpi/core/syscall.inc | 2 +- kernel/branches/Kolibri-acpi/core/taskman.inc | 50 +++-- .../Kolibri-acpi/core/test_malloc.asm | 2 +- kernel/branches/Kolibri-acpi/core/timers.inc | 2 +- kernel/branches/Kolibri-acpi/core/v86.inc | 8 +- kernel/branches/Kolibri-acpi/data16.inc | 2 +- kernel/branches/Kolibri-acpi/data32.inc | 9 +- kernel/branches/Kolibri-acpi/data32et.inc | 2 +- kernel/branches/Kolibri-acpi/data32sp.inc | 2 +- .../branches/Kolibri-acpi/detect/biosdisk.inc | 2 +- .../branches/Kolibri-acpi/detect/biosmem.inc | 2 +- .../branches/Kolibri-acpi/detect/dev_fd.inc | 2 +- .../branches/Kolibri-acpi/detect/dev_hdcd.inc | 2 +- kernel/branches/Kolibri-acpi/detect/disks.inc | 2 +- .../branches/Kolibri-acpi/detect/getcache.inc | 2 +- .../branches/Kolibri-acpi/detect/init_ata.inc | 2 +- .../branches/Kolibri-acpi/detect/sear_par.inc | 2 +- .../branches/Kolibri-acpi/detect/vortex86.inc | 2 +- .../branches/Kolibri-acpi/docs/sysfuncr.txt | 18 +- .../branches/Kolibri-acpi/docs/sysfuncs.txt | 70 +++---- kernel/branches/Kolibri-acpi/encoding.inc | 2 +- kernel/branches/Kolibri-acpi/fdo.inc | 2 +- .../branches/Kolibri-acpi/fs/ext2/blocks.inc | 2 +- kernel/branches/Kolibri-acpi/fs/ext2/ext2.asm | 2 +- kernel/branches/Kolibri-acpi/fs/ext2/ext2.inc | 2 +- .../branches/Kolibri-acpi/fs/ext2/inode.inc | 2 +- .../Kolibri-acpi/fs/ext2/resource.inc | 2 +- kernel/branches/Kolibri-acpi/fs/fat.inc | 2 +- kernel/branches/Kolibri-acpi/fs/fs_lfn.inc | 2 +- kernel/branches/Kolibri-acpi/fs/iso9660.inc | 2 +- kernel/branches/Kolibri-acpi/fs/ntfs.inc | 2 +- kernel/branches/Kolibri-acpi/fs/parse_fn.inc | 2 +- kernel/branches/Kolibri-acpi/fs/xfs.asm | 2 +- kernel/branches/Kolibri-acpi/fs/xfs.inc | 2 +- kernel/branches/Kolibri-acpi/gui/button.inc | 2 +- kernel/branches/Kolibri-acpi/gui/event.inc | 2 +- kernel/branches/Kolibri-acpi/gui/font.inc | 2 +- kernel/branches/Kolibri-acpi/gui/mouse.inc | 10 +- .../Kolibri-acpi/gui/mousepointer.inc | 2 +- kernel/branches/Kolibri-acpi/gui/skincode.inc | 2 +- kernel/branches/Kolibri-acpi/gui/skindata.inc | 2 +- kernel/branches/Kolibri-acpi/gui/window.inc | 51 ++--- kernel/branches/Kolibri-acpi/hid/keyboard.inc | 2 +- kernel/branches/Kolibri-acpi/hid/mousedrv.inc | 14 +- kernel/branches/Kolibri-acpi/hid/set_dtc.inc | 2 +- kernel/branches/Kolibri-acpi/imports.inc | 2 +- kernel/branches/Kolibri-acpi/init.inc | 10 +- kernel/branches/Kolibri-acpi/kernel.asm | 155 +++++++------- kernel/branches/Kolibri-acpi/kernel32.inc | 8 +- kernel/branches/Kolibri-acpi/kernelsp.inc | 2 +- kernel/branches/Kolibri-acpi/kglobals.inc | 2 +- kernel/branches/Kolibri-acpi/macros.inc | 2 +- kernel/branches/Kolibri-acpi/memmap.inc | 2 +- kernel/branches/Kolibri-acpi/network/ARP.inc | 9 +- kernel/branches/Kolibri-acpi/network/IPv4.inc | 24 +-- kernel/branches/Kolibri-acpi/network/IPv6.inc | 8 +- .../branches/Kolibri-acpi/network/PPPoE.inc | 11 +- .../Kolibri-acpi/network/ethernet.inc | 113 +++++++---- kernel/branches/Kolibri-acpi/network/icmp.inc | 189 +++++++++--------- .../Kolibri-acpi/network/loopback.inc | 76 +++---- .../branches/Kolibri-acpi/network/queue.inc | 2 +- .../branches/Kolibri-acpi/network/socket.inc | 44 ++-- .../branches/Kolibri-acpi/network/stack.inc | 108 +++++++++- kernel/branches/Kolibri-acpi/network/tcp.inc | 5 +- .../Kolibri-acpi/network/tcp_input.inc | 44 ++-- .../Kolibri-acpi/network/tcp_output.inc | 68 +++++-- .../Kolibri-acpi/network/tcp_subr.inc | 8 +- .../Kolibri-acpi/network/tcp_timer.inc | 6 +- .../Kolibri-acpi/network/tcp_usreq.inc | 6 +- kernel/branches/Kolibri-acpi/network/udp.inc | 18 +- kernel/branches/Kolibri-acpi/proc32.inc | 2 +- .../Kolibri-acpi/sec_loader/trunk/startos.ini | 6 +- .../branches/Kolibri-acpi/sound/playnote.inc | 2 +- kernel/branches/Kolibri-acpi/unpacker.inc | 2 +- .../branches/Kolibri-acpi/video/blitter.inc | 2 +- .../branches/Kolibri-acpi/video/cursors.inc | 50 ++--- kernel/branches/Kolibri-acpi/video/vesa12.inc | 2 +- kernel/branches/Kolibri-acpi/video/vesa20.inc | 46 ++--- kernel/branches/Kolibri-acpi/video/vga.inc | 2 +- 139 files changed, 1143 insertions(+), 768 deletions(-) diff --git a/kernel/branches/Kolibri-acpi/blkdev/bd_drv.inc b/kernel/branches/Kolibri-acpi/blkdev/bd_drv.inc index 4ae53cf381..ec191ef1d1 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/bd_drv.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/bd_drv.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/cd_drv.inc b/kernel/branches/Kolibri-acpi/blkdev/cd_drv.inc index c171931cd3..fd3da8e2b6 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/cd_drv.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/cd_drv.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/disk.inc b/kernel/branches/Kolibri-acpi/blkdev/disk.inc index a1dc94bda6..6cc0057af5 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/disk.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/disk.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2011-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/disk_cache.inc b/kernel/branches/Kolibri-acpi/blkdev/disk_cache.inc index f33df99389..cdf13dce47 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/disk_cache.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/disk_cache.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2011-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/fdc.inc b/kernel/branches/Kolibri-acpi/blkdev/fdc.inc index 7f0324cf61..ac05dd5001 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/fdc.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/fdc.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/flp_drv.inc b/kernel/branches/Kolibri-acpi/blkdev/flp_drv.inc index c4f36387f4..7d723b47bd 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/flp_drv.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/flp_drv.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/hd_drv.inc b/kernel/branches/Kolibri-acpi/blkdev/hd_drv.inc index d876db1f4a..fb035d8e1b 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/hd_drv.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/hd_drv.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/ide_cache.inc b/kernel/branches/Kolibri-acpi/blkdev/ide_cache.inc index 058f1321ec..e2e6490389 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/ide_cache.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/ide_cache.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/rd.inc b/kernel/branches/Kolibri-acpi/blkdev/rd.inc index 6bc32e66b4..491594f017 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/rd.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/rd.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; RAMDISK functions ;; diff --git a/kernel/branches/Kolibri-acpi/blkdev/rdsave.inc b/kernel/branches/Kolibri-acpi/blkdev/rdsave.inc index 23f7f06316..01534af819 100644 --- a/kernel/branches/Kolibri-acpi/blkdev/rdsave.inc +++ b/kernel/branches/Kolibri-acpi/blkdev/rdsave.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/bootcode.inc b/kernel/branches/Kolibri-acpi/boot/bootcode.inc index de2ea45af6..26f86bb5d5 100644 --- a/kernel/branches/Kolibri-acpi/boot/bootcode.inc +++ b/kernel/branches/Kolibri-acpi/boot/bootcode.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; diff --git a/kernel/branches/Kolibri-acpi/boot/booten.inc b/kernel/branches/Kolibri-acpi/boot/booten.inc index 3f9c228ca3..23d9d4fb0b 100644 --- a/kernel/branches/Kolibri-acpi/boot/booten.inc +++ b/kernel/branches/Kolibri-acpi/boot/booten.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/bootet.inc b/kernel/branches/Kolibri-acpi/boot/bootet.inc index 0b7d5ff483..7a61c5806e 100644 --- a/kernel/branches/Kolibri-acpi/boot/bootet.inc +++ b/kernel/branches/Kolibri-acpi/boot/bootet.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/bootge.inc b/kernel/branches/Kolibri-acpi/boot/bootge.inc index 05f06ac759..9117c889ff 100644 --- a/kernel/branches/Kolibri-acpi/boot/bootge.inc +++ b/kernel/branches/Kolibri-acpi/boot/bootge.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/bootru.inc b/kernel/branches/Kolibri-acpi/boot/bootru.inc index 76205d3cd5..ba4ceadb0e 100644 --- a/kernel/branches/Kolibri-acpi/boot/bootru.inc +++ b/kernel/branches/Kolibri-acpi/boot/bootru.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/bootsp.inc b/kernel/branches/Kolibri-acpi/boot/bootsp.inc index 3f9a80db68..75ddff377e 100644 --- a/kernel/branches/Kolibri-acpi/boot/bootsp.inc +++ b/kernel/branches/Kolibri-acpi/boot/bootsp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/bootstr.inc b/kernel/branches/Kolibri-acpi/boot/bootstr.inc index ac6abe0037..4299b6d620 100644 --- a/kernel/branches/Kolibri-acpi/boot/bootstr.inc +++ b/kernel/branches/Kolibri-acpi/boot/bootstr.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/bootvesa.inc b/kernel/branches/Kolibri-acpi/boot/bootvesa.inc index d8938f1f9a..6d31bc002f 100644 --- a/kernel/branches/Kolibri-acpi/boot/bootvesa.inc +++ b/kernel/branches/Kolibri-acpi/boot/bootvesa.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -218,7 +218,7 @@ calc_vmodes_table: test [es:mi.ModeAttributes], 10000000b ;LFB ? jz @f - cmp [es:mi.BitsPerPixel], 32 ;It show only videomodes to have support 24 and 32 bpp + cmp [es:mi.BitsPerPixel], 16 ;List only supported videomodes (16, 24 and 32 bpp) jb @f ; 16 bpp might actually be 15 bpp diff --git a/kernel/branches/Kolibri-acpi/boot/et.inc b/kernel/branches/Kolibri-acpi/boot/et.inc index 332107afc7..3e16256f5f 100644 --- a/kernel/branches/Kolibri-acpi/boot/et.inc +++ b/kernel/branches/Kolibri-acpi/boot/et.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/parsers.inc b/kernel/branches/Kolibri-acpi/boot/parsers.inc index 78c4284a81..69467376ca 100644 --- a/kernel/branches/Kolibri-acpi/boot/parsers.inc +++ b/kernel/branches/Kolibri-acpi/boot/parsers.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/preboot.inc b/kernel/branches/Kolibri-acpi/boot/preboot.inc index 77c169f51c..37713d06fe 100644 --- a/kernel/branches/Kolibri-acpi/boot/preboot.inc +++ b/kernel/branches/Kolibri-acpi/boot/preboot.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/rdload.inc b/kernel/branches/Kolibri-acpi/boot/rdload.inc index d41b6b561d..cc492078d3 100644 --- a/kernel/branches/Kolibri-acpi/boot/rdload.inc +++ b/kernel/branches/Kolibri-acpi/boot/rdload.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/ru.inc b/kernel/branches/Kolibri-acpi/boot/ru.inc index 77f7ab7d6e..c4d65cfd83 100644 --- a/kernel/branches/Kolibri-acpi/boot/ru.inc +++ b/kernel/branches/Kolibri-acpi/boot/ru.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/boot/shutdown.inc b/kernel/branches/Kolibri-acpi/boot/shutdown.inc index 625c681486..df17814c44 100644 --- a/kernel/branches/Kolibri-acpi/boot/shutdown.inc +++ b/kernel/branches/Kolibri-acpi/boot/shutdown.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Shutdown for Menuet ;; diff --git a/kernel/branches/Kolibri-acpi/bootloader/boot_fat12.asm b/kernel/branches/Kolibri-acpi/bootloader/boot_fat12.asm index 8d6704e895..9aeb52f411 100644 --- a/kernel/branches/Kolibri-acpi/bootloader/boot_fat12.asm +++ b/kernel/branches/Kolibri-acpi/bootloader/boot_fat12.asm @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/bootloader/floppy1440.inc b/kernel/branches/Kolibri-acpi/bootloader/floppy1440.inc index 118d087ec2..b1cefcc5f6 100644 --- a/kernel/branches/Kolibri-acpi/bootloader/floppy1440.inc +++ b/kernel/branches/Kolibri-acpi/bootloader/floppy1440.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/bootloader/floppy1680.inc b/kernel/branches/Kolibri-acpi/bootloader/floppy1680.inc index 8dfc57e101..7a89071bce 100644 --- a/kernel/branches/Kolibri-acpi/bootloader/floppy1680.inc +++ b/kernel/branches/Kolibri-acpi/bootloader/floppy1680.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/bootloader/floppy1743.inc b/kernel/branches/Kolibri-acpi/bootloader/floppy1743.inc index c1682c9874..41dd3117fd 100644 --- a/kernel/branches/Kolibri-acpi/bootloader/floppy1743.inc +++ b/kernel/branches/Kolibri-acpi/bootloader/floppy1743.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/bootloader/floppy2880.inc b/kernel/branches/Kolibri-acpi/bootloader/floppy2880.inc index 40d80b92f0..b26ef64009 100644 --- a/kernel/branches/Kolibri-acpi/bootloader/floppy2880.inc +++ b/kernel/branches/Kolibri-acpi/bootloader/floppy2880.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/bus/pci/PCIe.inc b/kernel/branches/Kolibri-acpi/bus/pci/PCIe.inc index 213b6b6814..78ecc9d8e1 100644 --- a/kernel/branches/Kolibri-acpi/bus/pci/PCIe.inc +++ b/kernel/branches/Kolibri-acpi/bus/pci/PCIe.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2010-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; ;; diff --git a/kernel/branches/Kolibri-acpi/bus/pci/pci16.inc b/kernel/branches/Kolibri-acpi/bus/pci/pci16.inc index 77c044f80a..238596f891 100644 --- a/kernel/branches/Kolibri-acpi/bus/pci/pci16.inc +++ b/kernel/branches/Kolibri-acpi/bus/pci/pci16.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; PCI16.INC ;; diff --git a/kernel/branches/Kolibri-acpi/bus/pci/pci32.inc b/kernel/branches/Kolibri-acpi/bus/pci/pci32.inc index d84d3e313d..3b241a8e7a 100644 --- a/kernel/branches/Kolibri-acpi/bus/pci/pci32.inc +++ b/kernel/branches/Kolibri-acpi/bus/pci/pci32.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; ;; diff --git a/kernel/branches/Kolibri-acpi/bus/usb/hccommon.inc b/kernel/branches/Kolibri-acpi/bus/usb/hccommon.inc index efc2064f89..9da133877d 100644 --- a/kernel/branches/Kolibri-acpi/bus/usb/hccommon.inc +++ b/kernel/branches/Kolibri-acpi/bus/usb/hccommon.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/bus/usb/hub.inc b/kernel/branches/Kolibri-acpi/bus/usb/hub.inc index 606a0122bc..46dd42d271 100644 --- a/kernel/branches/Kolibri-acpi/bus/usb/hub.inc +++ b/kernel/branches/Kolibri-acpi/bus/usb/hub.inc @@ -1,11 +1,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 4850 $ +$Revision: 5363 $ ; Support for USB (non-root) hubs: diff --git a/kernel/branches/Kolibri-acpi/bus/usb/init.inc b/kernel/branches/Kolibri-acpi/bus/usb/init.inc index af49513b16..53e3348dad 100644 --- a/kernel/branches/Kolibri-acpi/bus/usb/init.inc +++ b/kernel/branches/Kolibri-acpi/bus/usb/init.inc @@ -1,11 +1,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 4850 $ +$Revision: 5363 $ ; Initialization of the USB subsystem. diff --git a/kernel/branches/Kolibri-acpi/bus/usb/memory.inc b/kernel/branches/Kolibri-acpi/bus/usb/memory.inc index 1e55b07db2..74ae470b76 100644 --- a/kernel/branches/Kolibri-acpi/bus/usb/memory.inc +++ b/kernel/branches/Kolibri-acpi/bus/usb/memory.inc @@ -1,11 +1,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 4850 $ +$Revision: 5363 $ ; Memory management for USB structures. ; Protocol layer uses the common kernel heap malloc/free. diff --git a/kernel/branches/Kolibri-acpi/bus/usb/pipe.inc b/kernel/branches/Kolibri-acpi/bus/usb/pipe.inc index 4205dc98f6..9aa5d8e87f 100644 --- a/kernel/branches/Kolibri-acpi/bus/usb/pipe.inc +++ b/kernel/branches/Kolibri-acpi/bus/usb/pipe.inc @@ -1,11 +1,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 4850 $ +$Revision: 5363 $ ; Functions for USB pipe manipulation: opening/closing, sending data etc. diff --git a/kernel/branches/Kolibri-acpi/bus/usb/protocol.inc b/kernel/branches/Kolibri-acpi/bus/usb/protocol.inc index 29bc4a75e1..ab8f110345 100644 --- a/kernel/branches/Kolibri-acpi/bus/usb/protocol.inc +++ b/kernel/branches/Kolibri-acpi/bus/usb/protocol.inc @@ -1,11 +1,11 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 5177 $ +$Revision: 5363 $ ; Implementation of the USB protocol for device enumeration. diff --git a/kernel/branches/Kolibri-acpi/const.inc b/kernel/branches/Kolibri-acpi/const.inc index 9c9cb4087e..96ee86dfa0 100644 --- a/kernel/branches/Kolibri-acpi/const.inc +++ b/kernel/branches/Kolibri-acpi/const.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -98,6 +98,9 @@ CAPS_ALTMOVCR8 equ 74 ; MSR_SYSENTER_CS equ 0x174 MSR_SYSENTER_ESP equ 0x175 MSR_SYSENTER_EIP equ 0x176 +MSR_CR_PAT equ 0x277 +MSR_MTRR_DEF_TYPE equ 0x2FF + MSR_AMD_EFER equ 0xC0000080 ; Extended Feature Enable Register MSR_AMD_STAR equ 0xC0000081 ; SYSCALL/SYSRET Target Address Register @@ -271,17 +274,36 @@ REG_RET equ (RING0_STACK_SIZE-56) ;irq0.return PAGE_SIZE equ 4096 PG_UNMAP equ 0x000 -PG_MAP equ 0x001 +PG_READ equ 0x001 PG_WRITE equ 0x002 -PG_SW equ 0x003 -PG_USER equ 0x005 -PG_UW equ 0x007 -PG_NOCACHE equ 0x018 -PG_LARGE equ 0x080 +PG_USER equ 0x004 +PG_PCD equ 0x008 +PG_PWT equ 0x010 +PG_ACCESSED equ 0x020 +PG_DIRTY equ 0x040 +PG_PAT equ 0x080 PG_GLOBAL equ 0x100 - PG_SHARED equ 0x200 +PG_SWR equ 0x003 ; (PG_WRITE+PG_READ) +PG_UR equ 0x005 ; (PG_USER+PG_READ) +PG_UWR equ 0x007 ; (PG_USER+PG_WRITE+PG_READ) +PG_NOCACHE equ 0x018 ; (PG_PCD+PG_PWT) + +PDE_LARGE equ 0x080 + +PAT_WB equ 0x000 +PAT_WC equ 0x008 +PAT_UCM equ 0x010 +PAT_UC equ 0x018 + +PAT_TYPE_UC equ 0 +PAT_TYPE_WC equ 1 +PAT_TYPE_WB equ 6 +PAT_TYPE_UCM equ 7 + +PAT_VALUE equ 0x00070106; (UC<<24)|(UCM<<16)|(WC<<8)|WB + ;;;;;;;;;;;boot time variables BOOT_BPP equ 0x9000 ;byte bits per pixel @@ -425,38 +447,6 @@ struct HDLL parent dd ? ;DLLDESCR ends -struct display_t - x dd ? - y dd ? - width dd ? - height dd ? - bits_per_pixel dd ? - vrefresh dd ? - pitch dd ? - lfb dd ? - - modes dd ? - ddev dd ? - connector dd ? - crtc dd ? - - cr_list.next dd ? - cr_list.prev dd ? - - cursor dd ? - - init_cursor dd ? - select_cursor dd ? - show_cursor dd ? - move_cursor dd ? - restore_cursor dd ? - disable_mouse dd ? - mask_seqno dd ? - check_mouse dd ? - check_m_pixel dd ? - - bytes_per_pixel dd ? -ends struct BOOT_DATA bpp dd ? @@ -497,10 +487,54 @@ struct LHEAD ends struct MUTEX - lhead LHEAD + wait_list LHEAD + count dd ? +ends + +struct RWSEM + wait_list LHEAD count dd ? ends +struct display_t + x dd ? + y dd ? + width dd ? + height dd ? + bits_per_pixel dd ? + vrefresh dd ? + lfb dd ? + lfb_pitch dd ? + + win_map_lock RWSEM + win_map dd ? + win_map_pitch dd ? + win_map_size dd ? + + modes dd ? + ddev dd ? + connector dd ? + crtc dd ? + + cr_list.next dd ? + cr_list.prev dd ? + + cursor dd ? + + init_cursor dd ? + select_cursor dd ? + show_cursor dd ? + move_cursor dd ? + restore_cursor dd ? + disable_mouse dd ? + mask_seqno dd ? + check_mouse dd ? + check_m_pixel dd ? + + bytes_per_pixel dd ? +ends + + struct PCIDEV bk dd ? fd dd ? diff --git a/kernel/branches/Kolibri-acpi/core/apic.inc b/kernel/branches/Kolibri-acpi/core/apic.inc index 6a529afec8..4419a7e534 100644 --- a/kernel/branches/Kolibri-acpi/core/apic.inc +++ b/kernel/branches/Kolibri-acpi/core/apic.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -63,7 +63,7 @@ APIC_init: call IRQ_mask_all ; IOAPIC init - stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_SW+PG_NOCACHE + stdcall map_io_mem, [acpi_ioapic_base], 0x20, PG_GLOBAL+PG_NOCACHE+PG_SWR mov [IOAPIC_base], eax mov eax, IOAPIC_VER @@ -127,7 +127,7 @@ LAPIC_init: cmp [LAPIC_BASE], 0 jne .done - stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW+PG_NOCACHE + stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_GLOBAL+PG_NOCACHE+PG_SWR mov [LAPIC_BASE], eax mov esi, eax diff --git a/kernel/branches/Kolibri-acpi/core/clipboard.inc b/kernel/branches/Kolibri-acpi/core/clipboard.inc index c06c5f7ecb..4059b2d7d1 100644 --- a/kernel/branches/Kolibri-acpi/core/clipboard.inc +++ b/kernel/branches/Kolibri-acpi/core/clipboard.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/conf_lib-sp.inc b/kernel/branches/Kolibri-acpi/core/conf_lib-sp.inc index 98beb90382..71e3d562b3 100644 --- a/kernel/branches/Kolibri-acpi/core/conf_lib-sp.inc +++ b/kernel/branches/Kolibri-acpi/core/conf_lib-sp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/conf_lib.inc b/kernel/branches/Kolibri-acpi/core/conf_lib.inc index b74cd2abf2..920a35b93a 100644 --- a/kernel/branches/Kolibri-acpi/core/conf_lib.inc +++ b/kernel/branches/Kolibri-acpi/core/conf_lib.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/debug.inc b/kernel/branches/Kolibri-acpi/core/debug.inc index a1fcfdcd75..2dde5ff7b4 100644 --- a/kernel/branches/Kolibri-acpi/core/debug.inc +++ b/kernel/branches/Kolibri-acpi/core/debug.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/dll.inc b/kernel/branches/Kolibri-acpi/core/dll.inc index 344275ed01..a1687b5adc 100644 --- a/kernel/branches/Kolibri-acpi/core/dll.inc +++ b/kernel/branches/Kolibri-acpi/core/dll.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -517,7 +517,7 @@ proc load_file_umode stdcall, file_name:dword test eax, eax jz .err_3 - or eax, PG_UW + or eax, PG_UWR stosd dec edx jnz @B @@ -579,7 +579,7 @@ proc load_file_umode stdcall, file_name:dword @@: lodsd and eax, 0xFFFFF000 - or eax, PG_UW + or eax, PG_UWR stosd loop @B @@ -1144,7 +1144,7 @@ proc load_library stdcall, file_name:dword .map_pages_loop: mov eax, [page_tabs+ecx*4] and eax, not 0xFFF - or al, PG_USER + or al, PG_UR xchg eax, [page_tabs+edx*4] test al, 1 jz @f diff --git a/kernel/branches/Kolibri-acpi/core/export.inc b/kernel/branches/Kolibri-acpi/core/export.inc index 97e336c46f..5aa5ddbb60 100644 --- a/kernel/branches/Kolibri-acpi/core/export.inc +++ b/kernel/branches/Kolibri-acpi/core/export.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/exports.inc b/kernel/branches/Kolibri-acpi/core/exports.inc index 0186c46767..62d70f4a18 100644 --- a/kernel/branches/Kolibri-acpi/core/exports.inc +++ b/kernel/branches/Kolibri-acpi/core/exports.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -45,6 +45,11 @@ __exports: release_pages, 'ReleasePages', \ alloc_dma24, 'AllocDMA24', \ ; stdcall \ + init_rwsem, 'InitRwsem', \ ; gcc fastcall + down_read, 'DownRead', \ ; gcc fastcall + down_write, 'DownWrite', \ ; gcc fastcall + up_read, 'UpRead', \ ; gcc fastcall + up_write, 'UpWrite', \ ; gcc fastacll mutex_init, 'MutexInit', \ ; gcc fastcall mutex_lock, 'MutexLock', \ ; gcc fastcall mutex_unlock, 'MutexUnlock', \ ; gcc fastcall @@ -117,7 +122,9 @@ __exports: NET_remove_device, 'NetUnRegDev', \ NET_ptr_to_num, 'NetPtrToNum', \ NET_link_changed, 'NetLinkChanged', \ - ETH_input, 'Eth_input', \ + ETH_input, 'EthInput', \ + NET_BUFF_alloc, 'NetAlloc', \ + NET_BUFF_free, 'NetFree', \ \ get_pcidev_list, 'GetPCIList', \ \ diff --git a/kernel/branches/Kolibri-acpi/core/ext_lib.inc b/kernel/branches/Kolibri-acpi/core/ext_lib.inc index 9e367c4a4d..bcf8d135fb 100644 --- a/kernel/branches/Kolibri-acpi/core/ext_lib.inc +++ b/kernel/branches/Kolibri-acpi/core/ext_lib.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/fpu.inc b/kernel/branches/Kolibri-acpi/core/fpu.inc index dd38a73477..81e5d923ba 100644 --- a/kernel/branches/Kolibri-acpi/core/fpu.inc +++ b/kernel/branches/Kolibri-acpi/core/fpu.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/heap.inc b/kernel/branches/Kolibri-acpi/core/heap.inc index 7b03cb62d2..998c95953a 100644 --- a/kernel/branches/Kolibri-acpi/core/heap.inc +++ b/kernel/branches/Kolibri-acpi/core/heap.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -130,7 +130,7 @@ proc init_kernel_heap stdcall alloc_pages, dword 32 - or eax, PG_SW + or eax, PG_SWR mov ebx, HEAP_BASE mov ecx, 32 call commit_pages @@ -492,7 +492,7 @@ proc kernel_alloc stdcall, size:dword jz .err mov ecx, ebx - or eax, PG_SW + or eax, PG_GLOBAL+PG_SWR mov ebx, [lin_addr] call commit_pages @@ -506,7 +506,7 @@ proc kernel_alloc stdcall, size:dword test eax, eax jz .err - stdcall map_page, edx, eax, dword PG_SW + stdcall map_page, edx, eax, dword (PG_GLOBAL+PG_SWR) add edx, 0x1000 dec ebx jnz @B @@ -1451,7 +1451,7 @@ align 4 mov edx, [access] or edx, [owner_access] shl edx, 1 - or edx, PG_USER+PG_SHARED + or edx, PG_SHARED+PG_UR @@: lodsd and eax, 0xFFFFF000 diff --git a/kernel/branches/Kolibri-acpi/core/irq.inc b/kernel/branches/Kolibri-acpi/core/irq.inc index e6a7ea7870..49d264ab33 100644 --- a/kernel/branches/Kolibri-acpi/core/irq.inc +++ b/kernel/branches/Kolibri-acpi/core/irq.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/malloc.inc b/kernel/branches/Kolibri-acpi/core/malloc.inc index c4773c23df..b56119c8ca 100644 --- a/kernel/branches/Kolibri-acpi/core/malloc.inc +++ b/kernel/branches/Kolibri-acpi/core/malloc.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/memory.inc b/kernel/branches/Kolibri-acpi/core/memory.inc index 3399b02c44..42f1567255 100644 --- a/kernel/branches/Kolibri-acpi/core/memory.inc +++ b/kernel/branches/Kolibri-acpi/core/memory.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -127,8 +127,8 @@ align 4 map_page: push ebx mov eax, [esp+12] ; phis_addr - and eax, not 0xFFF or eax, [esp+16] ; flags + and eax, [pte_valid_mask] mov ebx, [esp+8] ; lin_addr shr ebx, 12 mov [page_tabs+ebx*4], eax @@ -191,8 +191,8 @@ proc map_io_mem stdcall, base:dword, size:dword, flags:dword mov edx, [base] shr eax, 12 shr ecx, 12 - and edx, -4096 or edx, [flags] + and edx, [pte_valid_mask] @@: mov [page_tabs+eax*4], edx invlpg [ebx] @@ -229,6 +229,7 @@ commit_pages: pop ecx pop eax + and eax, [pte_valid_mask ] mov edi, ebx shr edi, 12 lea edi, [page_tabs+edi*4] @@ -340,7 +341,7 @@ proc map_page_table stdcall, lin_addr:dword, phis_addr:dword shr ebx, 22 mov eax, [phis_addr] and eax, not 0xFFF - or eax, PG_UW ;+PG_NOCACHE + or eax, PG_UWR mov dword [master_tab+ebx*4], eax mov eax, [lin_addr] shr eax, 10 @@ -420,7 +421,7 @@ proc init_LFB call alloc_page stdcall map_page_table, LFB_BASE, eax pop eax - or eax, PG_UW + or eax, PG_UWR mov ebx, LFB_BASE ; max VGA=640*480*4=1228800 bytes ; + 32*640*4=81920 bytes for mouse pointer @@ -447,7 +448,7 @@ proc init_LFB bt [cpu_caps], CAPS_PSE jnc .map_page_tables - or esi, PG_LARGE+PG_UW + or esi, PDE_LARGE+PG_UWR mov edx, sys_proc+PROC.pdt_0+(LFB_BASE shr 20) @@: mov [edx], esi @@ -476,14 +477,14 @@ proc init_LFB mov eax, [LFBAddress] mov edi, page_tabs + (LFB_BASE shr 10) - or eax, PG_UW + or eax, PG_GLOBAL+PG_UWR + and eax, [pte_valid_mask] mov ecx, [pg_count] cld @@: stosd add eax, 0x1000 - dec ecx - jnz @B + loop @B mov dword [LFBAddress], LFB_BASE mov eax, cr3 ;flush TLB @@ -679,7 +680,7 @@ end if ret .user_space: - test eax, PG_MAP + test eax, PG_READ jnz .err_access ;Страница присутствует ;Ошибка доступа ? @@ -687,7 +688,7 @@ end if mov ecx, ebx shr ecx, 10 mov edx, [master_tab+ecx*4] - test edx, PG_MAP + test edx, PG_READ jz .fail ;таблица страниц не создана ;неверный адрес в программе @@ -700,7 +701,7 @@ end if test eax, eax jz .fail - stdcall map_page, [.err_addr], eax, PG_UW + stdcall map_page, [.err_addr], eax, PG_UWR mov edi, [.err_addr] and edi, 0xFFFFF000 @@ -737,7 +738,7 @@ end if call alloc_page test eax, eax jz .fail - stdcall map_page, ebx, eax, PG_UW + stdcall map_page, ebx, eax, PG_UWR mov edi, ebx mov ecx, 1024 sub ebx, [esi+HDLL.base] @@ -748,7 +749,7 @@ end if jmp .exit .kernel_space: - test eax, PG_MAP + test eax, PG_READ jz .fail ;страница не присутствует test eax, 12 ;U/S (+below) @@ -774,7 +775,7 @@ end if jz .fail push eax - stdcall map_page, [.err_addr], eax, dword PG_SW + stdcall map_page, [.err_addr], eax, dword PG_SWR pop eax mov edi, [.err_addr] and edi, -4096 @@ -783,7 +784,7 @@ end if mov ebx, esi shr ebx, 12 mov edx, [current_slot] - or eax, PG_SW + or eax, PG_SWR mov [edx+APPDATA.io_map+ebx*4], eax add esi, [default_io_map] @@ -818,7 +819,7 @@ proc map_mem_ipc stdcall, lin_addr:dword,slot:dword,\ mov esi, [ipc_ptab] and eax, 0xFFFFF000 jz .exit - stdcall map_page, esi, eax, PG_SW + stdcall map_page, esi, eax, PG_SWR @@: mov edi, [lin_addr] and edi, 0xFFFFF000 @@ -849,7 +850,7 @@ proc map_mem_ipc stdcall, lin_addr:dword,slot:dword,\ and eax, 0xFFFFF000 jz .exit - stdcall map_page, esi, eax, PG_SW + stdcall map_page, esi, eax, PG_SWR xor edx, edx jmp .map .exit: @@ -881,7 +882,7 @@ proc map_memEx stdcall, lin_addr:dword,slot:dword,\ mov esi, [proc_mem_tab] and eax, 0xFFFFF000 jz .exit - stdcall map_page, esi, eax, PG_SW + stdcall map_page, esi, eax, PG_SWR @@: mov edi, [lin_addr] and edi, 0xFFFFF000 @@ -912,7 +913,7 @@ proc map_memEx stdcall, lin_addr:dword,slot:dword,\ and eax, 0xFFFFF000 jz .exit - stdcall map_page, esi, eax, PG_SW + stdcall map_page, esi, eax, PG_SWR xor edx, edx jmp .map .exit: @@ -927,7 +928,7 @@ endp ; destroys: only eax proc safe_map_page stdcall, slot:dword, req_access:dword, ofs:dword mov eax, [esi+edx*4] - test al, PG_MAP + test al, PG_READ jz .not_present test al, PG_WRITE jz .resolve_readonly @@ -947,7 +948,7 @@ proc safe_map_page stdcall, slot:dword, req_access:dword, ofs:dword pop ecx test eax, eax jz .fail - or al, PG_UW + or al, PG_UWR mov [esi+edx*4], eax jmp .map .resolve_readonly: @@ -989,7 +990,7 @@ proc safe_map_page stdcall, slot:dword, req_access:dword, ofs:dword call alloc_page test eax, eax jz .no_hdll - or al, PG_UW + or al, PG_UWR mov [esi+edx*4], eax stdcall map_page, edi, eax, [req_access] push esi edi @@ -1090,7 +1091,7 @@ proc sys_ipc_send stdcall, PID:dword, msg_addr:dword, msg_size:dword @@: mov [used_buf], ecx stdcall map_mem_ipc, ecx, [dst_slot], \ - edi, esi, PG_SW + edi, esi, PG_SWR mov edi, [dst_offset] add edi, [used_buf] diff --git a/kernel/branches/Kolibri-acpi/core/mtrr.inc b/kernel/branches/Kolibri-acpi/core/mtrr.inc index ffb299432e..309ed2d4af 100644 --- a/kernel/branches/Kolibri-acpi/core/mtrr.inc +++ b/kernel/branches/Kolibri-acpi/core/mtrr.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -25,21 +25,65 @@ endp ; Helper procedure for mtrr_reconfigure and set_mtrr, ; called before changes in MTRRs. +; 1. disable and flush caches +; 2. clear PGE bit in cr4 +; 3. flush TLB +; 4. disable mtrr + proc mtrr_begin_change mov eax, cr0 or eax, 0x60000000 ;disable caching mov cr0, eax wbinvd ;invalidate cache + + bt [cpu_caps], CAPS_PGE + jnc .cr3_flush + + mov eax, cr4 + btr eax, 7 ;clear cr4.PGE + mov cr4, eax ;flush TLB + jmp @F ;skip extra serialization + +.cr3_flush: + mov eax, cr3 + mov cr3, eax ;flush TLB +@@: + mov ecx, MSR_MTRR_DEF_TYPE + rdmsr + btr eax, 11 ;clear enable flag + wrmsr ;disable mtrr ret endp ; Helper procedure for mtrr_reconfigure and set_mtrr, ; called after changes in MTRRs. +; 1. enable mtrr +; 2. flush all caches +; 3. flush TLB +; 4. restore cr4.PGE flag, if required + proc mtrr_end_change + mov ecx, MSR_MTRR_DEF_TYPE + rdmsr + or ah, 8 ; enable variable-ranges MTRR + and al, 0xF0 ; default memtype = UC + wrmsr + wbinvd ;again invalidate mov eax, cr0 and eax, not 0x60000000 mov cr0, eax ; enable caching + + mov eax, cr3 + mov cr3, eax ;flush tlb + + bt [cpu_caps], CAPS_PGE + jnc @F + + mov eax, cr4 + bts eax, 7 ;set cr4.PGE flag + mov cr4, eax +@@: ret endp @@ -695,12 +739,15 @@ end virtual jmp @b @@: -; 9i. Configure MTRR_DEF_TYPE. - mov ecx, 0x2FF - rdmsr - or ah, 8 ; enable variable-ranges MTRR - and al, 0xF0; default memtype = UC +; 9i. Check PAT support and reprogram PAT_MASR for write combining memory + bt [cpu_caps], CAPS_PAT + jnc @F + + mov ecx, MSR_CR_PAT + mov eax, PAT_VALUE ;UC UCM WC WB + mov edx, eax wrmsr +@@: ; 9j. Changes are done. call mtrr_end_change @@ -738,7 +785,9 @@ proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword ret .found: ; found, write values + push ecx call mtrr_begin_change + pop ecx xor edx, edx mov eax, [base] or eax, [mem_type] @@ -842,13 +891,13 @@ proc mtrr_validate ; It must be write-combined. test word [SCR_MODE], 0x4000 jz .exit - mov eax, [_display.pitch] + mov eax, [_display.lfb_pitch] mul [_display.height] dec eax ; LFB is mapped to virtual address LFB_BASE, ; it uses global pages if supported by CPU. mov ebx, [sys_proc+PROC.pdt_0+(LFB_BASE shr 20)] - test ebx, PG_LARGE + test ebx, PDE_LARGE jnz @f mov ebx, [page_tabs+(LFB_BASE shr 10)] @@: diff --git a/kernel/branches/Kolibri-acpi/core/peload.inc b/kernel/branches/Kolibri-acpi/core/peload.inc index 4cf5ffd018..bb8343424a 100644 --- a/kernel/branches/Kolibri-acpi/core/peload.inc +++ b/kernel/branches/Kolibri-acpi/core/peload.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -42,6 +42,7 @@ proc load_PE stdcall, file_name:dword jz .cleanup mov [base], eax + DEBUGF 1,'K : driver %s mapped to %x\n',[file_name],[base] push ebx ebp mov ebx, [image] diff --git a/kernel/branches/Kolibri-acpi/core/sched.inc b/kernel/branches/Kolibri-acpi/core/sched.inc index 4add4b3ccf..d3fac9c0c0 100644 --- a/kernel/branches/Kolibri-acpi/core/sched.inc +++ b/kernel/branches/Kolibri-acpi/core/sched.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -116,8 +116,6 @@ do_change_task: Mov [tss._esp0],eax,[ebx+APPDATA.saved_esp0] mov edx, [ebx+APPDATA.tls_base] - cmp edx, [esi+APPDATA.tls_base] - je @f mov [tls_data_l+2], dx shr edx, 16 @@ -126,7 +124,7 @@ do_change_task: mov dx, app_tls mov fs, dx -@@: + ; set gs selector unconditionally Mov gs,ax,graph_data ; set CR0.TS @@ -155,22 +153,24 @@ do_change_task: ;end. - struct MUTEX_WAITER list LHEAD task dd ? + type dd ? ends +RWSEM_WAITING_FOR_WRITE equ 0 +RWSEM_WAITING_FOR_READ equ 1 + ;void __fastcall mutex_init(struct mutex *lock) align 4 mutex_init: - mov [ecx+MUTEX.lhead.next], ecx - mov [ecx+MUTEX.lhead.prev], ecx + mov [ecx+MUTEX.wait_list.next], ecx + mov [ecx+MUTEX.wait_list.prev], ecx mov [ecx+MUTEX.count], 1 ret - ;void __fastcall mutex_lock(struct mutex *lock) align 4 @@ -200,15 +200,13 @@ mutex_lock: call change_task jmp .forever @@: - mov edx, [esp+MUTEX_WAITER.list.next] - mov eax, [esp+MUTEX_WAITER.list.prev] + mov eax, ecx + list_del esp - mov [eax+MUTEX_WAITER.list.next], edx - mov [edx+MUTEX_WAITER.list.prev], eax - cmp [ecx+MUTEX.lhead.next], ecx + cmp [eax+MUTEX.wait_list.next], eax jne @F - mov [ecx+MUTEX.count], 0 + mov [eax+MUTEX.count], 0 @@: add esp, sizeof.MUTEX_WAITER @@ -224,7 +222,7 @@ mutex_unlock: pushfd cli - mov eax, [ecx+MUTEX.lhead.next] + mov eax, [ecx+MUTEX.wait_list.next] cmp eax, ecx mov [ecx+MUTEX.count], 1 je @F @@ -236,7 +234,166 @@ mutex_unlock: ret +;void __fastcall init_rwsem(struct rw_semaphore *sem) + +align 4 +init_rwsem: + mov [ecx+RWSEM.wait_list.next], ecx + mov [ecx+RWSEM.wait_list.prev], ecx + mov [ecx+RWSEM.count], 0 + ret + +;void __fastcall down_read(struct rw_semaphore *sem) + +align 4 +down_read: + pushfd + cli + + mov eax, [ecx+RWSEM.count] + test eax, eax + js @F + + cmp ecx, [ecx+RWSEM.wait_list.next] + je .ok +@@: + sub esp, sizeof.MUTEX_WAITER + + mov eax, [TASK_BASE] + mov [esp+MUTEX_WAITER.task], eax + mov [esp+MUTEX_WAITER.type], RWSEM_WAITING_FOR_READ + mov [eax+TASKDATA.state], 1 + + list_add_tail esp, ecx ;esp= new waiter, ecx= list head + + call change_task + + add esp, sizeof.MUTEX_WAITER + popfd + ret +.ok: + inc eax + mov [ecx+RWSEM.count], eax + + popfd + ret + +;void __fastcall down_write(struct rw_semaphore *sem) + +align 4 +down_write: + pushfd + cli + sub esp, sizeof.MUTEX_WAITER + + mov edx, [TASK_BASE] + mov [esp+MUTEX_WAITER.task], edx + mov [esp+MUTEX_WAITER.type], RWSEM_WAITING_FOR_WRITE + mov [edx+TASKDATA.state], 1 + + list_add_tail esp, ecx ;esp= new waiter, ecx= list head + + xor eax, eax + not eax + +.forever: + test eax, [ecx+RWSEM.count] + jz @F + + mov [edx+TASKDATA.state], 1 + call change_task + jmp .forever +@@: + mov [ecx+RWSEM.count], eax + list_del esp + + add esp, sizeof.MUTEX_WAITER + popfd + ret + +;void __fastcall up_read(struct rw_semaphore *sem) + +align 4 +up_read: + pushfd + cli + + dec [ecx+RWSEM.count] + jnz @F + + mov eax, [ecx+RWSEM.wait_list.next] + cmp eax, ecx + je @F + + mov eax, [eax+MUTEX_WAITER.task] + mov [eax+TASKDATA.state], 0 +@@: + popfd + ret + +;void __fastcall up_write(struct rw_semaphore *sem) + +align 4 +up_write: + + pushfd + cli + + mov eax, [ecx+RWSEM.wait_list.next] + mov [ecx+RWSEM.count], 0 + + cmp ecx, eax + je .done + + mov edx, [eax+MUTEX_WAITER.type] + test edx, edx + jnz .wake + + mov eax, [eax+MUTEX_WAITER.task] + mov [eax+TASKDATA.state], 0 +.done: + popfd + ret + +.wake: + push ebx + push esi + push edi + + xor esi, esi + mov edi, ecx + +.wake_list: + + mov ebx, [eax+MUTEX_WAITER.list.next] + list_del eax + mov edx, [eax+MUTEX_WAITER.task] + mov [edx+TASKDATA.state], 0 + inc esi + cmp edi, ebx + je .wake_done + + mov ecx, [ebx+MUTEX_WAITER.type] + test ecx, ecx + jz .wake_done + + mov eax, ebx + jmp .wake_list + +.wake_done: + add [edi+RWSEM.count], esi + + pop edi + pop esi + pop ebx + popfd + ret + + purge MUTEX_WAITER +purge RWSEM_WAITING_FOR_WRITE +purge RWSEM_WAITING_FOR_READ + MAX_PRIORITY = 0 ; highest, used for kernel tasks USER_PRIORITY = 1 ; default diff --git a/kernel/branches/Kolibri-acpi/core/string.inc b/kernel/branches/Kolibri-acpi/core/string.inc index c58a930720..3e217d1a34 100644 --- a/kernel/branches/Kolibri-acpi/core/string.inc +++ b/kernel/branches/Kolibri-acpi/core/string.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; Author: Kees J. Bot 1 Jan 1994 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/sync.inc b/kernel/branches/Kolibri-acpi/core/sync.inc index c3fbdf8407..d2b5721009 100644 --- a/kernel/branches/Kolibri-acpi/core/sync.inc +++ b/kernel/branches/Kolibri-acpi/core/sync.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Synhronization for MenuetOS. ;; diff --git a/kernel/branches/Kolibri-acpi/core/sys32-sp.inc b/kernel/branches/Kolibri-acpi/core/sys32-sp.inc index 17bf1c3384..76c01701cc 100644 --- a/kernel/branches/Kolibri-acpi/core/sys32-sp.inc +++ b/kernel/branches/Kolibri-acpi/core/sys32-sp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/sys32.inc b/kernel/branches/Kolibri-acpi/core/sys32.inc index aa8ffe76fa..b703851282 100644 --- a/kernel/branches/Kolibri-acpi/core/sys32.inc +++ b/kernel/branches/Kolibri-acpi/core/sys32.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; ;; @@ -308,7 +308,7 @@ show_error_parameters: mov ecx, ebx shr ecx, 10 mov edx, [master_tab+ecx*4] - test edx, PG_MAP + test edx, PG_READ jz .fail ;page table is not created ;incorrect address in the program diff --git a/kernel/branches/Kolibri-acpi/core/syscall.inc b/kernel/branches/Kolibri-acpi/core/syscall.inc index b720e4baf0..9f7b4b6c49 100644 --- a/kernel/branches/Kolibri-acpi/core/syscall.inc +++ b/kernel/branches/Kolibri-acpi/core/syscall.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/taskman.inc b/kernel/branches/Kolibri-acpi/core/taskman.inc index c4e25214a9..c2ce2cb805 100644 --- a/kernel/branches/Kolibri-acpi/core/taskman.inc +++ b/kernel/branches/Kolibri-acpi/core/taskman.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -489,7 +489,7 @@ proc create_process stdcall, app_size:dword,img_base:dword,img_size:dword cmp eax, ecx jbe @B - mov [edi-4096+PROC.ht_next], 1 ;reserve handle 0 + mov [edi-4096+PROC.ht_next], 3 ;reserve handles for stdin stdout and stderr mov eax, edi call get_pg_addr mov [edi-4096+PROC.pdt_0_phys], eax @@ -503,16 +503,13 @@ proc create_process stdcall, app_size:dword,img_base:dword,img_size:dword rep movsd mov eax, [edi-8192+PROC.pdt_0_phys] - or eax, PG_SW + or eax, PG_SWR mov [edi-4096+(page_tabs shr 20)], eax lea eax, [edi-8192] call set_cr3 - mov ecx, [app_tabs] - test ecx, ecx - jz .done - + mov edx, [app_tabs] xor edi, edi @@: call alloc_page @@ -521,7 +518,8 @@ proc create_process stdcall, app_size:dword,img_base:dword,img_size:dword stdcall map_page_table, edi, eax add edi, 0x00400000 - loop @B + dec edx + jnz @B mov edi, page_tabs @@ -530,13 +528,9 @@ proc create_process stdcall, app_size:dword,img_base:dword,img_size:dword xor eax, eax rep stosd - xor edx, edx mov ecx, [img_pages] - jcxz .bss - - sub [app_pages], ecx - - mov ebx, PG_UW + mov ebx, PG_UWR + xor edx, edx mov esi, [img_base] shr esi, 10 add esi, page_tabs @@ -547,21 +541,23 @@ proc create_process stdcall, app_size:dword,img_base:dword,img_size:dword or eax, ebx; force user level r/w access stosd add edx, 0x1000 - loop .remap -.bss: - mov ebx, [app_pages] - test ebx, ebx + dec [app_pages] + dec ecx + jnz .remap + + mov ecx, [app_pages] + test ecx, ecx jz .done -.map_bss: +.alloc: call alloc_page test eax, eax jz .fail - stdcall map_page, edx, eax, dword PG_UW + stdcall map_page, edx, eax, dword PG_UWR add edx, 0x1000 - dec ebx - jnz .map_bss + dec [app_pages] + jnz .alloc .done: mov ecx, pg_data.mutex @@ -647,7 +643,7 @@ align 4 test eax, 1 jz .next and eax, not 0xFFF - stdcall map_page, [tmp_task_ptab], eax, PG_SW + stdcall map_page, [tmp_task_ptab], eax, PG_SWR stdcall destroy_page_table, [tmp_task_ptab] mov eax, [esi] call free_page @@ -792,7 +788,7 @@ proc read_process_memory push ecx stdcall map_memEx, [proc_mem_map], \ - [slot], ebx, ecx, PG_MAP + [slot], ebx, ecx, PG_READ pop ecx mov esi, [offset] @@ -863,7 +859,7 @@ proc write_process_memory ; add ebx, new_app_base push ecx stdcall map_memEx, [proc_mem_map], \ - [slot], ebx, ecx, PG_SW + [slot], ebx, ecx, PG_SWR pop ecx mov edi, [offset] @@ -1145,9 +1141,9 @@ proc set_app_params stdcall,slot:dword, params:dword,\ xor eax, eax mov [ecx+0], dword eax mov [ecx+4], dword eax - mov eax, [Screen_Max_X] + mov eax, [screen_workarea.right] mov [ecx+8], eax - mov eax, [Screen_Max_Y] + mov eax, [screen_workarea.bottom] mov [ecx+12], eax mov ebx, [pl0_stack] diff --git a/kernel/branches/Kolibri-acpi/core/test_malloc.asm b/kernel/branches/Kolibri-acpi/core/test_malloc.asm index 0112c91e19..629b72fa1b 100644 --- a/kernel/branches/Kolibri-acpi/core/test_malloc.asm +++ b/kernel/branches/Kolibri-acpi/core/test_malloc.asm @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2009-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2009-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/timers.inc b/kernel/branches/Kolibri-acpi/core/timers.inc index b343b8c7a4..6bab712c89 100644 --- a/kernel/branches/Kolibri-acpi/core/timers.inc +++ b/kernel/branches/Kolibri-acpi/core/timers.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2012-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/core/v86.inc b/kernel/branches/Kolibri-acpi/core/v86.inc index a71ec99002..4e1e43564e 100644 --- a/kernel/branches/Kolibri-acpi/core/v86.inc +++ b/kernel/branches/Kolibri-acpi/core/v86.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2007-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2007-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -78,7 +78,7 @@ v86_create: ; (I have seen one computer with EBDA segment = 0x9D80, ; all other computers use less memory) - mov eax, PG_UW + mov eax, PG_UWR mov [page_tabs], eax invlpg [eax] @@ -89,7 +89,7 @@ v86_create: mov byte [0x504], 0x10 mov byte [0x505], 0xF4 - mov eax, 0x99000+PG_UW + mov eax, 0x99000+PG_UWR mov edi, page_tabs+0x99*4 mov edx, 0x1000 mov ecx, 7 @@ -101,7 +101,7 @@ v86_create: ; addresses 0xC0000 - 0xFFFFF - BIOS code (shared between all machines!) ; physical address = 0xC0000 - mov eax, 0xC0000+PG_UW + mov eax, 0xC0000+PG_UWR mov edi, page_tabs+0xC0*4 mov ecx, 64 @@: diff --git a/kernel/branches/Kolibri-acpi/data16.inc b/kernel/branches/Kolibri-acpi/data16.inc index e0311b05b1..b8fa33a0eb 100644 --- a/kernel/branches/Kolibri-acpi/data16.inc +++ b/kernel/branches/Kolibri-acpi/data16.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/data32.inc b/kernel/branches/Kolibri-acpi/data32.inc index ef41a9c13e..733fbebd50 100644 --- a/kernel/branches/Kolibri-acpi/data32.inc +++ b/kernel/branches/Kolibri-acpi/data32.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -361,6 +361,7 @@ next_memblock rd 1 mst MEM_STATE +pte_valid_mask rd 1 page_start rd 1 page_end rd 1 sys_page_map rd 1 @@ -375,12 +376,8 @@ align 16 _display display_t -_WinMapAddress rd 1 -_WinMapSize rd 1 LFBAddress dd ? -Screen_Max_X dd ? -Screen_Max_Y dd ? SCR_MODE rw 2 @@ -425,8 +422,6 @@ cur_saved_base rd 1 cur.lock rd 1 ;1 - lock update, 2- hide cur.left rd 1 ;cursor clip box cur.top rd 1 -cur.right rd 1 -cur.bottom rd 1 cur.w rd 1 cur.h rd 1 diff --git a/kernel/branches/Kolibri-acpi/data32et.inc b/kernel/branches/Kolibri-acpi/data32et.inc index 689a3ed3ae..c48aebb45c 100644 --- a/kernel/branches/Kolibri-acpi/data32et.inc +++ b/kernel/branches/Kolibri-acpi/data32et.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/data32sp.inc b/kernel/branches/Kolibri-acpi/data32sp.inc index ae0208d78b..42430502df 100644 --- a/kernel/branches/Kolibri-acpi/data32sp.inc +++ b/kernel/branches/Kolibri-acpi/data32sp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/biosdisk.inc b/kernel/branches/Kolibri-acpi/detect/biosdisk.inc index 96aa12ec60..0bfbd9db6a 100644 --- a/kernel/branches/Kolibri-acpi/detect/biosdisk.inc +++ b/kernel/branches/Kolibri-acpi/detect/biosdisk.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2008-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2008-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/biosmem.inc b/kernel/branches/Kolibri-acpi/detect/biosmem.inc index 82a99018f0..2ac3e7f361 100644 --- a/kernel/branches/Kolibri-acpi/detect/biosmem.inc +++ b/kernel/branches/Kolibri-acpi/detect/biosmem.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2009-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2009-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/dev_fd.inc b/kernel/branches/Kolibri-acpi/detect/dev_fd.inc index 2d34b110fd..fd495f1d40 100644 --- a/kernel/branches/Kolibri-acpi/detect/dev_fd.inc +++ b/kernel/branches/Kolibri-acpi/detect/dev_fd.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/dev_hdcd.inc b/kernel/branches/Kolibri-acpi/detect/dev_hdcd.inc index 7f4f00991e..4f07f90ace 100644 --- a/kernel/branches/Kolibri-acpi/detect/dev_hdcd.inc +++ b/kernel/branches/Kolibri-acpi/detect/dev_hdcd.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/disks.inc b/kernel/branches/Kolibri-acpi/detect/disks.inc index 5430ceb824..71cd1e1518 100644 --- a/kernel/branches/Kolibri-acpi/detect/disks.inc +++ b/kernel/branches/Kolibri-acpi/detect/disks.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/getcache.inc b/kernel/branches/Kolibri-acpi/detect/getcache.inc index 261d8a860f..7828f03ab2 100644 --- a/kernel/branches/Kolibri-acpi/detect/getcache.inc +++ b/kernel/branches/Kolibri-acpi/detect/getcache.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/init_ata.inc b/kernel/branches/Kolibri-acpi/detect/init_ata.inc index ac784bd7d3..9cbdde8cf0 100644 --- a/kernel/branches/Kolibri-acpi/detect/init_ata.inc +++ b/kernel/branches/Kolibri-acpi/detect/init_ata.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2014-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/sear_par.inc b/kernel/branches/Kolibri-acpi/detect/sear_par.inc index 870d545f54..bb0f749848 100644 --- a/kernel/branches/Kolibri-acpi/detect/sear_par.inc +++ b/kernel/branches/Kolibri-acpi/detect/sear_par.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/detect/vortex86.inc b/kernel/branches/Kolibri-acpi/detect/vortex86.inc index 2fca0a6d1b..5251f589e5 100644 --- a/kernel/branches/Kolibri-acpi/detect/vortex86.inc +++ b/kernel/branches/Kolibri-acpi/detect/vortex86.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/docs/sysfuncr.txt b/kernel/branches/Kolibri-acpi/docs/sysfuncr.txt index 2503e339bc..5a9d50056c 100644 --- a/kernel/branches/Kolibri-acpi/docs/sysfuncr.txt +++ b/kernel/branches/Kolibri-acpi/docs/sysfuncr.txt @@ -835,7 +835,7 @@ сворачивание окна осуществляется системой при нажатии на кнопку минимизации (которая для окон со скином определяется автоматически функцией 0, для окон без скина её можно определить функцией 8), - восстановление - приложением @panel. + восстановление - приложением @taskbar. ====================================================================== ====================== Функция 18, подфункция 11 ===================== @@ -1212,9 +1212,9 @@ dd 1675 * Получить раскладки и идентификатор страны можно с помощью подфункции 2 функции 26. * Идентификатор страны - глобальная системная переменная, которая - самим ядром не используется; однако приложение @panel отображает + самим ядром не используется; однако приложение @taskbar отображает соответствующую текущей стране иконку. - * Приложение @panel переключает раскладки по запросу пользователя. + * Приложение @taskbar переключает раскладки по запросу пользователя. ====================================================================== ========= Функция 21, подфункция 5 - установить язык системы. ======== @@ -1227,7 +1227,7 @@ dd 1675 * eax = 0 Замечания: * Язык системы - глобальная системная переменная, никак - не используемая самим ядром, однако приложение @panel рисует + не используемая самим ядром, однако приложение @taskbar рисует соответствующую иконку. * Проверок на корректность не делается, поскольку ядро эту переменную не использует. @@ -1426,10 +1426,10 @@ dd 1675 * Установить раскладки и идентификатор страны можно с помощью подфункции 2 функции 21. * Идентификатор страны - глобальная системная переменная, которая - самим ядром не используется; однако приложение @panel отображает + самим ядром не используется; однако приложение @taskbar отображает соответствующую текущей стране иконку (используя описываемую функцию). - * Приложение @panel переключает раскладки по запросу пользователя. + * Приложение @taskbar переключает раскладки по запросу пользователя. ====================================================================== ========== Функция 26, подфункция 5 - получить язык системы. ========= @@ -1441,7 +1441,7 @@ dd 1675 * eax = язык системы (1=eng, 2=fi, 3=ger, 4=rus) Замечания: * Язык системы - глобальная системная переменная, никак - не используемая самим ядром, однако приложение @panel рисует + не используемая самим ядром, однако приложение @taskbar рисует соответствующую иконку (используя описываемую функцию). * Установить язык системы можно вызовом подфункции 5 функции 21. @@ -2006,7 +2006,7 @@ dword-значение цвета 0x00RRGGBB * Рабочая область экрана определяет положение и координаты максимизированного окна. * Рабочая область экрана при нормальной работе есть весь экран - за вычетом панели (@panel). + за вычетом панели (@taskbar). * (left,top) - координаты левого верхнего угла, (right,bottom) - координаты правого нижнего. Таким образом, размер рабочей области по оси x определяется @@ -2028,7 +2028,7 @@ dword-значение цвета 0x00RRGGBB Замечания: * Рабочая область экрана определяет положение и координаты максимизированного окна. - * Эта функция используется только приложением @panel, + * Эта функция используется только приложением @taskbar, устанавливающим рабочей областью весь экран за вычетом панели. * (left,top) - координаты левого верхнего угла, (right,bottom) - координаты правого нижнего. diff --git a/kernel/branches/Kolibri-acpi/docs/sysfuncs.txt b/kernel/branches/Kolibri-acpi/docs/sysfuncs.txt index 0d0f71b5a4..d43225b6a5 100644 --- a/kernel/branches/Kolibri-acpi/docs/sysfuncs.txt +++ b/kernel/branches/Kolibri-acpi/docs/sysfuncs.txt @@ -836,7 +836,7 @@ Remarks: at pressing the minimization button (for skinned windows it is defined automatically by function 0, for other windows it can be defined manually by function 8), - restore of a window is done by the application '@panel'. + restore of a window is done by the application '@taskbar'. ====================================================================== Function 18, subfunction 11 - get information on the disk subsystem. @@ -861,8 +861,8 @@ Format of the table: short version: * 5 = 2.88Mb, 3.5'' (such drives are not used anymore) For example, for the standard configuration from one 1.44-drive here will be 40h, and for the case 1.2Mb on A: and 1.44Mb on B: - the value is 24h. - + the value is 24h. + First IDE controller: * +1: byte: information about hard disks and CD-drives, AABBCCDD, where AA corresponds to the controller IDE0, ..., DD - IDE3: @@ -872,29 +872,29 @@ Format of the table: short version: For example, in the case HD on IDE0 and CD on IDE2 this field contains 48h. * +2: 4 db: number of the retrieved partitions on hard disks - at accordingly IDE0,...,IDE3. - - Second IDE controller: - * +6: byte: information about hard disks and CD-drives, AABBCCDD, - where AA corresponds to the controller IDE4, ..., DD - IDE7: - * 0 = device not found - * 1 = hard drive - * 2 = CD-drive - For example, in the case HD on IDE4 and CD on IDE6 - this field contains 48h. - * +7: 4 db: number of the retrieved partitions on hard disks - at accordingly IDE4,...,IDE7. - - Third IDE controller: - * +11: byte: information about hard disks and CD-drives, AABBCCDD, - where AA corresponds to the controller IDE8, ..., DD - IDE11: - * 0 = device not found - * 1 = hard drive - * 2 = CD-drive - For example, in the case HD on IDE8 and CD on IDE10 - this field contains 48h. - * +12: 4 db: number of the retrieved partitions on hard disks - at accordingly IDE8,...,IDE11. + at accordingly IDE0,...,IDE3. + + Second IDE controller: + * +6: byte: information about hard disks and CD-drives, AABBCCDD, + where AA corresponds to the controller IDE4, ..., DD - IDE7: + * 0 = device not found + * 1 = hard drive + * 2 = CD-drive + For example, in the case HD on IDE4 and CD on IDE6 + this field contains 48h. + * +7: 4 db: number of the retrieved partitions on hard disks + at accordingly IDE4,...,IDE7. + + Third IDE controller: + * +11: byte: information about hard disks and CD-drives, AABBCCDD, + where AA corresponds to the controller IDE8, ..., DD - IDE11: + * 0 = device not found + * 1 = hard drive + * 2 = CD-drive + For example, in the case HD on IDE8 and CD on IDE10 + this field contains 48h. + * +12: 4 db: number of the retrieved partitions on hard disks + at accordingly IDE8,...,IDE11. If the hard disk on IDEx is absent, appropriate byte is zero, otherwise it shows number of the recognized partitions, which @@ -1213,9 +1213,9 @@ Remarks: * To get layout and country identifier use subfunction 2 of function 26. * Country identifier is global system variable, which is not used - by the kernel itself; however the application '@panel' displays + by the kernel itself; however the application '@taskbar' displays the corresponding icon. - * The application @panel switches layouts on user request. + * The application @taskbar switches layouts on user request. ====================================================================== ========== Function 21, subfunction 5 - set system language. ========= @@ -1228,7 +1228,7 @@ Returned value: * eax = 0 Remarks: * System language is global system variable and is not used - by the kernel itself, however application @panel draws the + by the kernel itself, however application @taskbar draws the appropriate icon. * Function does not check for correctness, as the kernel does not use this variable. @@ -1422,9 +1422,9 @@ Remarks: * To set layout and country identifier use subfunction 2 of function 21. * Country identifier is global system variable, which is not used - by the kernel itself; however the application '@panel' displays + by the kernel itself; however the application '@taskbar' displays the corresponding icon (using this function). - * The application @panel switches layouts on user request. + * The application @taskbar switches layouts on user request. ====================================================================== ========== Function 26, subfunction 5 - get system language. ========= @@ -1436,7 +1436,7 @@ Returned value: * eax = system language (1=eng, 2=fi, 3=ger, 4=rus) Remarks: * System language is global system variable and is not used - by the kernel itself, however application @panel draws the + by the kernel itself, however application @taskbar draws the appropriate icon (using this function). * To set system language use subfunction 5 of function 21. @@ -1996,7 +1996,7 @@ Remarks: * The screen working area defines position and coordinates of a maximized window. * The screen working area in view of normal work is all screen - without system panel (the application '@panel'). + without taskbar ('@taskbar' application). * (left,top) are coordinates of the left upper corner, (right,bottom) are coordinates of the right lower one. Thus the size of working area on x axis can be calculated by @@ -2018,8 +2018,8 @@ Returned value: Remarks: * The screen working area defines position and coordinates of a maximized window. - * This function is used only by the application '@panel', - which set working area to all screen without system panel. + * This function is used only by the application '@taskbar', + which set working area to all screen without taskbar. * (left,top) are coordinates of the left upper corner, (right,bottom) are coordinates of the right lower one. Thus the size of working area on x axis can be calculated by diff --git a/kernel/branches/Kolibri-acpi/encoding.inc b/kernel/branches/Kolibri-acpi/encoding.inc index 80c1ad39a2..0df097a29a 100644 --- a/kernel/branches/Kolibri-acpi/encoding.inc +++ b/kernel/branches/Kolibri-acpi/encoding.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fdo.inc b/kernel/branches/Kolibri-acpi/fdo.inc index 7353c26fa4..0343b4fc22 100644 --- a/kernel/branches/Kolibri-acpi/fdo.inc +++ b/kernel/branches/Kolibri-acpi/fdo.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/ext2/blocks.inc b/kernel/branches/Kolibri-acpi/fs/ext2/blocks.inc index 0576a5205b..c940b56c93 100644 --- a/kernel/branches/Kolibri-acpi/fs/ext2/blocks.inc +++ b/kernel/branches/Kolibri-acpi/fs/ext2/blocks.inc @@ -2,7 +2,7 @@ ;; ;; ;; Contains ext2 block handling code. ;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/ext2/ext2.asm b/kernel/branches/Kolibri-acpi/fs/ext2/ext2.asm index 665a80c175..e5a546aff4 100644 --- a/kernel/branches/Kolibri-acpi/fs/ext2/ext2.asm +++ b/kernel/branches/Kolibri-acpi/fs/ext2/ext2.asm @@ -2,7 +2,7 @@ ;; ;; ;; Contains ext2 initialization, plus syscall handling code. ;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/ext2/ext2.inc b/kernel/branches/Kolibri-acpi/fs/ext2/ext2.inc index a03c1ba308..99922ae4fa 100644 --- a/kernel/branches/Kolibri-acpi/fs/ext2/ext2.inc +++ b/kernel/branches/Kolibri-acpi/fs/ext2/ext2.inc @@ -2,7 +2,7 @@ ;; ;; ;; Contains ext2 structures, and macros. ;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/ext2/inode.inc b/kernel/branches/Kolibri-acpi/fs/ext2/inode.inc index 01b89053b2..3810548440 100644 --- a/kernel/branches/Kolibri-acpi/fs/ext2/inode.inc +++ b/kernel/branches/Kolibri-acpi/fs/ext2/inode.inc @@ -2,7 +2,7 @@ ;; ;; ;; Contains ext2 inode handling code. ;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/ext2/resource.inc b/kernel/branches/Kolibri-acpi/fs/ext2/resource.inc index e0a7f2dfa2..c68912d176 100644 --- a/kernel/branches/Kolibri-acpi/fs/ext2/resource.inc +++ b/kernel/branches/Kolibri-acpi/fs/ext2/resource.inc @@ -2,7 +2,7 @@ ;; ;; ;; Contains common resource allocation + freeing code. ;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/fat.inc b/kernel/branches/Kolibri-acpi/fs/fat.inc index 6331002403..36c6305a21 100644 --- a/kernel/branches/Kolibri-acpi/fs/fat.inc +++ b/kernel/branches/Kolibri-acpi/fs/fat.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; FAT32.INC ;; diff --git a/kernel/branches/Kolibri-acpi/fs/fs_lfn.inc b/kernel/branches/Kolibri-acpi/fs/fs_lfn.inc index 2d74437315..ec9730d07c 100644 --- a/kernel/branches/Kolibri-acpi/fs/fs_lfn.inc +++ b/kernel/branches/Kolibri-acpi/fs/fs_lfn.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/iso9660.inc b/kernel/branches/Kolibri-acpi/fs/iso9660.inc index a10da72825..cde3d95a54 100644 --- a/kernel/branches/Kolibri-acpi/fs/iso9660.inc +++ b/kernel/branches/Kolibri-acpi/fs/iso9660.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/ntfs.inc b/kernel/branches/Kolibri-acpi/fs/ntfs.inc index 0b05c7cac0..7510d275f8 100644 --- a/kernel/branches/Kolibri-acpi/fs/ntfs.inc +++ b/kernel/branches/Kolibri-acpi/fs/ntfs.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/parse_fn.inc b/kernel/branches/Kolibri-acpi/fs/parse_fn.inc index 4801b2a23c..b6e6cfe372 100644 --- a/kernel/branches/Kolibri-acpi/fs/parse_fn.inc +++ b/kernel/branches/Kolibri-acpi/fs/parse_fn.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/xfs.asm b/kernel/branches/Kolibri-acpi/fs/xfs.asm index 780f8ded01..72867da1e6 100644 --- a/kernel/branches/Kolibri-acpi/fs/xfs.asm +++ b/kernel/branches/Kolibri-acpi/fs/xfs.asm @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/fs/xfs.inc b/kernel/branches/Kolibri-acpi/fs/xfs.inc index fe9916cf21..c174b662f5 100644 --- a/kernel/branches/Kolibri-acpi/fs/xfs.inc +++ b/kernel/branches/Kolibri-acpi/fs/xfs.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/gui/button.inc b/kernel/branches/Kolibri-acpi/gui/button.inc index 125bd54061..c320b6b6ea 100644 --- a/kernel/branches/Kolibri-acpi/gui/button.inc +++ b/kernel/branches/Kolibri-acpi/gui/button.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; diff --git a/kernel/branches/Kolibri-acpi/gui/event.inc b/kernel/branches/Kolibri-acpi/gui/event.inc index 99dce2fb72..3f05bd7135 100644 --- a/kernel/branches/Kolibri-acpi/gui/event.inc +++ b/kernel/branches/Kolibri-acpi/gui/event.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/gui/font.inc b/kernel/branches/Kolibri-acpi/gui/font.inc index f1395531bb..60dfad86a5 100644 --- a/kernel/branches/Kolibri-acpi/gui/font.inc +++ b/kernel/branches/Kolibri-acpi/gui/font.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/gui/mouse.inc b/kernel/branches/Kolibri-acpi/gui/mouse.inc index a44084f201..e064fe2660 100644 --- a/kernel/branches/Kolibri-acpi/gui/mouse.inc +++ b/kernel/branches/Kolibri-acpi/gui/mouse.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2010-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2010-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -407,7 +407,7 @@ mouse._.move_handler: ;//////////////////////////////////////////////////////// @@: add eax, [mouse.active_sys_window.new_box.height] cmp eax, [_display.height] - jle .call_window_handler + jl .call_window_handler sub eax, [_display.height] sub [mouse.active_sys_window.new_box.top], eax jmp .call_window_handler @@ -486,10 +486,10 @@ mouse._.move_handler: ;//////////////////////////////////////////////////////// add eax, [mouse.active_sys_window.new_box.left] cmp eax, [_display.width] jl .call_window_handler - sub eax, [_display.height] + sub eax, [_display.width] neg eax add [mouse.active_sys_window.new_box.width], eax - mov ecx, [_display.height] + mov ecx, [_display.width] cmp ecx, eax jg .call_window_handler mov [mouse.active_sys_window.new_box.width], ecx @@ -526,7 +526,7 @@ mouse._.find_sys_window_under_cursor: ;//////////////////////////////////////// mov esi, [mouse.state.pos.y] mov esi, [d_width_calc_area + esi*4] - add esi, [_WinMapAddress] + add esi, [_display.win_map] add esi, [mouse.state.pos.x] movzx esi, byte[esi] mov edi, esi diff --git a/kernel/branches/Kolibri-acpi/gui/mousepointer.inc b/kernel/branches/Kolibri-acpi/gui/mousepointer.inc index bc3a7ce320..ec4ddbb436 100644 --- a/kernel/branches/Kolibri-acpi/gui/mousepointer.inc +++ b/kernel/branches/Kolibri-acpi/gui/mousepointer.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/gui/skincode.inc b/kernel/branches/Kolibri-acpi/gui/skincode.inc index c90ffe75c2..050fed93df 100644 --- a/kernel/branches/Kolibri-acpi/gui/skincode.inc +++ b/kernel/branches/Kolibri-acpi/gui/skincode.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/gui/skindata.inc b/kernel/branches/Kolibri-acpi/gui/skindata.inc index b44da52625..a664150fcc 100644 --- a/kernel/branches/Kolibri-acpi/gui/skindata.inc +++ b/kernel/branches/Kolibri-acpi/gui/skindata.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/gui/window.inc b/kernel/branches/Kolibri-acpi/gui/window.inc index f6e9cc2cfd..e2ef758ed5 100644 --- a/kernel/branches/Kolibri-acpi/gui/window.inc +++ b/kernel/branches/Kolibri-acpi/gui/window.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; @@ -215,7 +215,8 @@ align 4 syscall_display_settings.06: xor esi, esi - mov edi, [Screen_Max_X] + mov edi, [_display.width] + dec edi mov eax, ecx movsx ebx, ax sar eax, 16 @@ -239,7 +240,8 @@ align 4 ;-------------------------------------- align 4 .check_horizontal: - mov edi, [Screen_Max_Y] + mov edi, [_display.height] + dec edi mov eax, edx movsx ebx, ax sar eax, 16 @@ -300,8 +302,10 @@ align 4 syscall_display_settings._.calculate_whole_screen: xor eax, eax xor ebx, ebx - mov ecx, [Screen_Max_X] - mov edx, [Screen_Max_Y] + mov ecx, [_display.width] + mov edx, [_display.height] + dec ecx + dec edx jmp calculatescreen ;------------------------------------------------------------------------------ align 4 @@ -309,9 +313,11 @@ syscall_display_settings._.redraw_whole_screen: xor eax, eax mov [draw_limits.left], eax mov [draw_limits.top], eax - mov eax, [Screen_Max_X] + mov eax, [_display.width] + dec eax mov [draw_limits.right], eax - mov eax, [Screen_Max_Y] + mov eax, [_display.height] + dec eax mov [draw_limits.bottom], eax mov eax, window_data jmp redrawscreen @@ -590,12 +596,12 @@ align 4 mov eax, [edi + WDATA.box.left] add eax, [edi + WDATA.box.width] - mov ebx, [Screen_Max_X] + mov ebx, [_display.width] cmp eax, ebx - jle .fix_vertical + jl .fix_vertical mov eax, [edi + WDATA.box.width] sub eax, ebx - jle @f + jl @f mov [edi + WDATA.box.width], ebx ;-------------------------------------- align 4 @@ -607,12 +613,12 @@ align 4 .fix_vertical: mov eax, [edi + WDATA.box.top] add eax, [edi + WDATA.box.height] - mov ebx, [Screen_Max_Y] + mov ebx, [_display.height] cmp eax, ebx - jle .fix_client_box + jl .fix_client_box mov eax, [edi + WDATA.box.height] sub eax, ebx - jle @f + jl @f mov [edi + WDATA.box.height], ebx ;-------------------------------------- align 4 @@ -1718,9 +1724,9 @@ window._.check_window_position: ;////////////////////////////////////////////// mov ecx, [edi + WDATA.box.width] mov edx, [edi + WDATA.box.height] - mov esi, [Screen_Max_X] + mov esi, [_display.width] cmp ecx, esi - ja .fix_width_high + jae .fix_width_high ;-------------------------------------- align 4 .check_left: @@ -1728,13 +1734,13 @@ align 4 jl .fix_left_low add eax, ecx cmp eax, esi - jg .fix_left_high + jge .fix_left_high ;-------------------------------------- align 4 .check_height: - mov esi, [Screen_Max_Y] + mov esi, [_display.height] cmp edx, esi - ja .fix_height_high + jae .fix_height_high ;-------------------------------------- align 4 .check_top: @@ -1742,7 +1748,7 @@ align 4 jl .fix_top_low add ebx, edx cmp ebx, esi - jg .fix_top_high + jge .fix_top_high ;-------------------------------------- align 4 .exit: @@ -1887,7 +1893,7 @@ align 4 mov edi, [d_width_calc_area + ebx*4] add edi, eax - add edi, [_WinMapAddress] + add edi, [_display.win_map] pop eax mov ah, al push ax @@ -1929,7 +1935,7 @@ align 4 mov eax, [d_width_calc_area + ebx*4] add eax, [esp] - add eax, [_WinMapAddress] + add eax, [_display.win_map] mov ebp, eax mov edi, [edi + APPDATA.wnd_shape] @@ -1992,8 +1998,7 @@ align 4 sub ebp, [ff_xsz] add ebp, [ff_x] - add ebp, [Screen_Max_X] ; screen.x - inc ebp + add ebp, [_display.width] ; screen.x inc ebx cmp ebx, [ff_ysz] jb .ff_new_y diff --git a/kernel/branches/Kolibri-acpi/hid/keyboard.inc b/kernel/branches/Kolibri-acpi/hid/keyboard.inc index 41f4dcadce..3195aea28c 100644 --- a/kernel/branches/Kolibri-acpi/hid/keyboard.inc +++ b/kernel/branches/Kolibri-acpi/hid/keyboard.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Copyright (C) MenuetOS 2000-2004 Ville Mikael Turjanmaa ;; ;; Distributed under terms of the GNU General Public License ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/hid/mousedrv.inc b/kernel/branches/Kolibri-acpi/hid/mousedrv.inc index ddf11ad96a..e9f4e0588d 100644 --- a/kernel/branches/Kolibri-acpi/hid/mousedrv.inc +++ b/kernel/branches/Kolibri-acpi/hid/mousedrv.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -115,7 +115,7 @@ save_draw_mouse: ; mul ecx mov eax, [d_width_calc_area + eax*4] - add eax, [_WinMapAddress] + add eax, [_display.win_map] movzx edx, byte [ebx+eax] shl edx, 8 mov esi, [edx+SLOT_BASE+APPDATA.cursor] @@ -501,9 +501,10 @@ proc set_mouse_data stdcall uses edx, BtnState:dword, XMoving:dword, YMoving:dwo mul edx shr eax, 15 .check_x: - cmp ax, word[Screen_Max_X] + cmp ax, word[_display.width] jl .set_x - mov ax, word[Screen_Max_X] + mov ax, word[_display.width] + dec ax .set_x: mov [MOUSE_X], ax ;-------------------------------------- @@ -522,9 +523,10 @@ proc set_mouse_data stdcall uses edx, BtnState:dword, XMoving:dword, YMoving:dwo mul edx shr eax, 15 .check_y: - cmp ax, word[Screen_Max_Y] + cmp ax, word[_display.height] jl .set_y - mov ax, word[Screen_Max_Y] + mov ax, word[_display.height] + dec ax .set_y: mov [MOUSE_Y], ax ;-------------------------------------- diff --git a/kernel/branches/Kolibri-acpi/hid/set_dtc.inc b/kernel/branches/Kolibri-acpi/hid/set_dtc.inc index 2515bf4878..45eba57d5a 100644 --- a/kernel/branches/Kolibri-acpi/hid/set_dtc.inc +++ b/kernel/branches/Kolibri-acpi/hid/set_dtc.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/imports.inc b/kernel/branches/Kolibri-acpi/imports.inc index dcb91f4665..95dbc1bd21 100644 --- a/kernel/branches/Kolibri-acpi/imports.inc +++ b/kernel/branches/Kolibri-acpi/imports.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/init.inc b/kernel/branches/Kolibri-acpi/init.inc index b4491daf82..263a20b276 100644 --- a/kernel/branches/Kolibri-acpi/init.inc +++ b/kernel/branches/Kolibri-acpi/init.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -139,7 +139,7 @@ proc init_mem mov ebx, cr4 or ebx, CR4_PSE - mov eax, PG_LARGE+PG_SW + mov eax, PDE_LARGE+PG_SWR mov cr4, ebx dec [pg_data.kernel_tables-OS_BASE] @@ -149,7 +149,7 @@ proc init_mem mov edi, [tmp_page_tabs] jmp .map_kernel_heap ; new kernel fits to the first 4Mb - nothing to do with ".map_low" .no_PSE: - mov eax, PG_SW + mov eax, PG_SWR mov ecx, [tmp_page_tabs] shr ecx, 12 .map_low: @@ -168,7 +168,7 @@ proc init_mem mov ecx, [pg_data.kernel_tables-OS_BASE] mov eax, [tmp_page_tabs] - or eax, PG_SW + or eax, PG_SWR mov edi, edx .map_kernel_tabs: @@ -177,7 +177,7 @@ proc init_mem dec ecx jnz .map_kernel_tabs - mov dword [sys_proc-OS_BASE+PROC.pdt_0+(page_tabs shr 20)], sys_proc+PROC.pdt_0+PG_SW-OS_BASE + mov dword [sys_proc-OS_BASE+PROC.pdt_0+(page_tabs shr 20)], sys_proc+PROC.pdt_0+PG_SWR-OS_BASE mov edi, (sys_proc+PROC.pdt_0-OS_BASE) lea esi, [edi+(OS_BASE shr 20)] diff --git a/kernel/branches/Kolibri-acpi/kernel.asm b/kernel/branches/Kolibri-acpi/kernel.asm index bbf983a785..0d1c3e044f 100644 --- a/kernel/branches/Kolibri-acpi/kernel.asm +++ b/kernel/branches/Kolibri-acpi/kernel.asm @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; PROGRAMMING: ;; Ivan Poddubny ;; Marat Zakiyanov (Mario79) @@ -351,15 +351,26 @@ high_code: mov fs, cx mov gs, bx + xor eax, eax + mov ebx, 0xFFFFF000+PG_SHARED+PG_NOCACHE+PG_UWR + bt [cpu_caps], CAPS_PAT + setc al + shl eax, 7 + or ebx, eax + + mov eax, PG_GLOBAL bt [cpu_caps], CAPS_PGE jnc @F - or dword [sys_proc+PROC.pdt_0+(OS_BASE shr 20)], PG_GLOBAL + or [sys_proc+PROC.pdt_0+(OS_BASE shr 20)], eax + or ebx, eax - mov ebx, cr4 - or ebx, CR4_PGE - mov cr4, ebx + mov eax, cr4 + or eax, CR4_PGE + mov cr4, eax @@: + mov [pte_valid_mask], ebx + xor eax, eax mov dword [sys_proc+PROC.pdt_0], eax mov dword [sys_proc+PROC.pdt_0+4], eax @@ -444,13 +455,11 @@ high_code: mov [_display.width], eax mov [display_width_standard], eax dec eax - mov [Screen_Max_X], eax mov [screen_workarea.right], eax movzx eax, word [BOOT_VARS+BOOT_Y_RES]; Y max mov [_display.height], eax mov [display_height_standard], eax dec eax - mov [Screen_Max_Y], eax mov [screen_workarea.bottom], eax movzx eax, word [BOOT_VARS+BOOT_VESA_MODE] ; screen mode mov dword [SCR_MODE], eax @@ -463,10 +472,10 @@ high_code: je @f movzx eax, word[BOOT_VARS+BOOT_PITCH] ; for other modes @@: - mov [_display.pitch], eax + mov [_display.lfb_pitch], eax mov eax, [_display.width] mul [_display.height] - mov [_WinMapSize], eax + mov [_display.win_map_size], eax call calculate_fast_getting_offset_for_WinMapAddress ; for Qemu or non standart video cards @@ -577,11 +586,11 @@ setvideomode: .noSYSCALL: ; ----------------------------------------- stdcall alloc_page - stdcall map_page, tss-0xF80, eax, PG_SW + stdcall map_page, tss-0xF80, eax, PG_SWR stdcall alloc_page - stdcall map_page, tss+0x80, eax, PG_SW + stdcall map_page, tss+0x80, eax, PG_SWR stdcall alloc_page - stdcall map_page, tss+0x1080, eax, PG_SW + stdcall map_page, tss+0x1080, eax, PG_SWR ; LOAD IDT @@ -661,8 +670,8 @@ setvideomode: mov [graph_data_l+4], al mov [graph_data_l+7], ah - stdcall kernel_alloc, [_WinMapSize] - mov [_WinMapAddress], eax + stdcall kernel_alloc, [_display.win_map_size] + mov [_display.win_map], eax xor eax, eax inc eax @@ -756,7 +765,7 @@ endg mov edi, OS_BASE + 8000h mov ecx, (ap_init16_size + 3) / 4 rep movsd - stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_SW+PG_NOCACHE + stdcall map_io_mem, [acpi_lapic_base], 0x1000, PG_GLOBAL+PG_NOCACHE+PG_SWR mov [LAPIC_BASE], eax lea edi, [eax+300h] mov esi, smpt+4 @@ -1061,14 +1070,14 @@ include "detect/vortex86.inc" ; Vortex86 SoC detection code ;protect io permission map mov esi, [default_io_map] - stdcall map_page, esi, [SLOT_BASE+256+APPDATA.io_map], PG_MAP + stdcall map_page, esi, [SLOT_BASE+256+APPDATA.io_map], PG_READ add esi, 0x1000 - stdcall map_page, esi, [SLOT_BASE+256+APPDATA.io_map+4], PG_MAP + stdcall map_page, esi, [SLOT_BASE+256+APPDATA.io_map+4], PG_READ stdcall map_page, tss._io_map_0, \ - [SLOT_BASE+256+APPDATA.io_map], PG_MAP + [SLOT_BASE+256+APPDATA.io_map], PG_READ stdcall map_page, tss._io_map_1, \ - [SLOT_BASE+256+APPDATA.io_map+4], PG_MAP + [SLOT_BASE+256+APPDATA.io_map+4], PG_READ ; SET KEYBOARD PARAMETERS mov al, 0xf6 ; reset keyboard, scan enabled @@ -2114,7 +2123,7 @@ restore_default_cursor_before_killing: movzx ebx, word [MOUSE_X] mov eax, [d_width_calc_area + eax*4] - add eax, [_WinMapAddress] + add eax, [_display.win_map] movzx edx, byte [ebx+eax] shl edx, 8 mov esi, [edx+SLOT_BASE+APPDATA.cursor] @@ -2406,10 +2415,10 @@ sysfn_centermouse: ; 18.15 = mouse centered ;* mouse centered - start code- Mario79 ;mouse_centered: ; push eax - mov eax, [Screen_Max_X] + mov eax, [_display.width] shr eax, 1 mov [MOUSE_X], ax - mov eax, [Screen_Max_Y] + mov eax, [_display.height] shr eax, 1 mov [MOUSE_Y], ax call wakeup_osloop @@ -2451,11 +2460,11 @@ sysfn_mouse_acceleration: ; 18.19 = set/get mouse features ; cmp ecx,4 ; set mouse pointer position dec ecx jnz .set_mouse_button - cmp dx, word[Screen_Max_Y] - ja .end + cmp dx, word[_display.height] + jae .end rol edx, 16 - cmp dx, word[Screen_Max_X] - ja .end + cmp dx, word[_display.width] + jae .end mov [MOUSE_X], edx mov [mouse_active], 1 call wakeup_osloop @@ -2541,7 +2550,7 @@ sysfn_set_screen_sizes: pushfd cli mov eax, ecx - mov ecx, [_display.pitch] + mov ecx, [_display.lfb_pitch] mov [_display.width], eax dec eax mov [_display.height], edx @@ -2804,7 +2813,7 @@ align 4 align 4 @@: mov eax, [page_tabs+esi*4] - or al, PG_UW + or al, PG_UWR mov [page_tabs+ebx*4], eax mov eax, ebx shl eax, 12 @@ -2882,8 +2891,10 @@ nosb8: jnz nosb9 ; ecx = [left]*65536 + [right] ; edx = [top]*65536 + [bottom] - mov eax, [Screen_Max_X] - mov ebx, [Screen_Max_Y] + mov eax, [_display.width] + mov ebx, [_display.height] + dec eax + dec ebx ; check [right] cmp cx, ax ja .exit @@ -2935,8 +2946,10 @@ force_redraw_background: and [draw_data+32 + RECT.left], 0 and [draw_data+32 + RECT.top], 0 push eax ebx - mov eax, [Screen_Max_X] - mov ebx, [Screen_Max_Y] + mov eax, [_display.width] + mov ebx, [_display.height] + dec eax + dec ebx mov [draw_data+32 + RECT.right], eax mov [draw_data+32 + RECT.bottom], ebx pop ebx eax @@ -3298,9 +3311,11 @@ sys_redrawstat: add edx, draw_data - CURRENT_TASK mov [edx + RECT.left], 0 mov [edx + RECT.top], 0 - mov eax, [Screen_Max_X] + mov eax, [_display.width] + dec eax mov [edx + RECT.right], eax - mov eax, [Screen_Max_Y] + mov eax, [_display.height] + dec eax mov [edx + RECT.bottom], eax srl1: @@ -3819,7 +3834,7 @@ align 4 .start_x: add eax, ecx mov ebp, [d_width_calc_area + ebx*4] - add ebp, [_WinMapAddress] + add ebp, [_display.win_map] movzx ebp, byte[eax+ebp] ; get value for current point cmp ebp, edi jne @f @@ -3864,9 +3879,9 @@ not_this_task: ;----------------------------------------------------------------------------- align 4 calculatebackground: ; background - mov edi, [_WinMapAddress] ; set os to use all pixels + mov edi, [_display.win_map] ; set os to use all pixels mov eax, 0x01010101 - mov ecx, [_WinMapSize] + mov ecx, [_display.win_map_size] shr ecx, 2 rep stosd @@ -4793,9 +4808,9 @@ endg jnz @f mov word [msg_board_pos+2], (42*6) add word [msg_board_pos], 10 - mov ax, word [Screen_Max_Y] + mov ax, word [_display.width] cmp word [msg_board_pos], ax - jbe @f + jb @f mov word [msg_board_pos], 10 @@: ; // end if @@ -5012,10 +5027,9 @@ sys_gs: ; direct screen access .1: ; resolution - mov eax, [Screen_Max_X] + mov eax, [_display.width] shl eax, 16 - mov ax, word [Screen_Max_Y] - add eax, 0x00010001 + mov ax, word [_display.height] mov [esp+32], eax ret .2: ; bits per pixel @@ -5023,7 +5037,7 @@ sys_gs: ; direct screen access mov [esp+32], eax ret .3: ; bytes per scanline - mov eax, [_display.pitch] + mov eax, [_display.lfb_pitch] mov [esp+32], eax ret @@ -5100,9 +5114,11 @@ syscall_drawrect: ; DrawRect align 4 syscall_getscreensize: ; GetScreenSize - mov ax, word [Screen_Max_X] + mov ax, word [_display.width] + dec ax shl eax, 16 - mov ax, word [Screen_Max_Y] + mov ax, word [_display.height] + dec ax mov [esp + 32], eax ret ;----------------------------------------------------------------------------- @@ -5178,17 +5194,17 @@ syscall_cdaudio: ;----------------------------------------------------------------------------- align 4 syscall_getpixel_WinMap: ; GetPixel WinMap - cmp ebx, [Screen_Max_X] - jbe @f - cmp ecx, [Screen_Max_Y] - jbe @f + cmp ebx, [_display.width] + jb @f + cmp ecx, [_display.height] + jb @f xor eax, eax jmp .store ;-------------------------------------- align 4 @@: mov eax, [d_width_calc_area + ecx*4] - add eax, [_WinMapAddress] + add eax, [_display.win_map] movzx eax, byte[eax+ebx] ; get value for current point ;-------------------------------------- align 4 @@ -5198,8 +5214,7 @@ align 4 ;----------------------------------------------------------------------------- align 4 syscall_getpixel: ; GetPixel - mov ecx, [Screen_Max_X] - inc ecx + mov ecx, [_display.width] xor edx, edx mov eax, ebx div ecx @@ -5328,7 +5343,7 @@ align 4 pushad mov edx, [d_width_calc_area + ebx*4] - add edx, [_WinMapAddress] + add edx, [_display.win_map] movzx edx, byte [eax+edx] cmp dl, byte 1 jne @f @@ -5429,7 +5444,7 @@ calculate_fast_getting_offset_for_LFB: cld @@: stosd - add eax, [_display.pitch] + add eax, [_display.lfb_pitch] dec ecx jnz @r ret @@ -5444,9 +5459,7 @@ set_screen: pushfd cli - mov [Screen_Max_X], eax - mov [Screen_Max_Y], edx - mov [_display.pitch], ecx + mov [_display.lfb_pitch], ecx mov [screen_workarea.right], eax mov [screen_workarea.bottom], edx @@ -5460,14 +5473,14 @@ set_screen: cmp [do_not_touch_winmap], 1 je @f - stdcall kernel_free, [_WinMapAddress] + stdcall kernel_free, [_display.win_map] mov eax, [_display.width] mul [_display.height] - mov [_WinMapSize], eax + mov [_display.win_map_size], eax stdcall kernel_alloc, eax - mov [_WinMapAddress], eax + mov [_display.win_map], eax test eax, eax jz .epic_fail ; store for f.18.24 @@ -5487,8 +5500,10 @@ set_screen: call repos_windows xor eax, eax xor ebx, ebx - mov ecx, [Screen_Max_X] - mov edx, [Screen_Max_Y] + mov ecx, [_display.width] + mov edx, [_display.height] + dec ecx + dec edx call calculatescreen pop edi pop esi @@ -5650,10 +5665,10 @@ end if .rsdp_found: mov esi, [eax+16] ; esi contains physical address of the RSDT mov ebp, [ipc_tmp] - stdcall map_page, ebp, esi, PG_MAP + stdcall map_page, ebp, esi, PG_READ lea eax, [esi+1000h] lea edx, [ebp+1000h] - stdcall map_page, edx, eax, PG_MAP + stdcall map_page, edx, eax, PG_READ and esi, 0xFFF add esi, ebp cmp dword [esi], 'RSDT' @@ -5667,10 +5682,10 @@ end if lodsd mov ebx, eax lea eax, [ebp+2000h] - stdcall map_page, eax, ebx, PG_MAP + stdcall map_page, eax, ebx, PG_READ lea eax, [ebp+3000h] add ebx, 0x1000 - stdcall map_page, eax, ebx, PG_MAP + stdcall map_page, eax, ebx, PG_READ and ebx, 0xFFF lea ebx, [ebx+ebp+2000h] cmp dword [ebx], 'FACP' @@ -5681,10 +5696,10 @@ end if ; ebx is linear address of FADT mov edi, [ebx+40] ; physical address of the DSDT lea eax, [ebp+4000h] - stdcall map_page, eax, edi, PG_MAP + stdcall map_page, eax, edi, PG_READ lea eax, [ebp+5000h] lea esi, [edi+0x1000] - stdcall map_page, eax, esi, PG_MAP + stdcall map_page, eax, esi, PG_READ and esi, 0xFFF sub edi, esi cmp dword [esi+ebp+4000h], 'DSDT' @@ -5732,8 +5747,8 @@ end if add edi, 0x1000 push eax lea eax, [ebp+4000h] - stdcall map_page, eax, edi, PG_MAP - push PG_MAP + stdcall map_page, eax, edi, PG_READ + push PG_READ lea eax, [edi+1000h] push eax lea eax, [ebp+5000h] diff --git a/kernel/branches/Kolibri-acpi/kernel32.inc b/kernel/branches/Kolibri-acpi/kernel32.inc index e1b871a132..6ee2e0ed99 100644 --- a/kernel/branches/Kolibri-acpi/kernel32.inc +++ b/kernel/branches/Kolibri-acpi/kernel32.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; KERNEL32.INC ;; @@ -111,9 +111,9 @@ struct PROC io_map_0 rd 1 io_map_1 rd 1 - ht_lock rd 1 - ht_next rd 1 - htab rd (4096-$)/4 + ht_lock rd 1 ;htab[0] stdin + ht_next rd 1 ;htab[1] stdout + htab rd (4096-$)/4 ;htab[2] stderr pdt_0 rd 1024 ends diff --git a/kernel/branches/Kolibri-acpi/kernelsp.inc b/kernel/branches/Kolibri-acpi/kernelsp.inc index bd2d5c40ec..a308f6aca2 100644 --- a/kernel/branches/Kolibri-acpi/kernelsp.inc +++ b/kernel/branches/Kolibri-acpi/kernelsp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2013-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2013-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/kglobals.inc b/kernel/branches/Kolibri-acpi/kglobals.inc index 30d7747df2..0d1e9e905d 100644 --- a/kernel/branches/Kolibri-acpi/kglobals.inc +++ b/kernel/branches/Kolibri-acpi/kglobals.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/macros.inc b/kernel/branches/Kolibri-acpi/macros.inc index 0295709bb4..7062230069 100644 --- a/kernel/branches/Kolibri-acpi/macros.inc +++ b/kernel/branches/Kolibri-acpi/macros.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/memmap.inc b/kernel/branches/Kolibri-acpi/memmap.inc index 921c78dc8a..1a967c454a 100644 --- a/kernel/branches/Kolibri-acpi/memmap.inc +++ b/kernel/branches/Kolibri-acpi/memmap.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/network/ARP.inc b/kernel/branches/Kolibri-acpi/network/ARP.inc index faf4c8c002..338d65f7fb 100644 --- a/kernel/branches/Kolibri-acpi/network/ARP.inc +++ b/kernel/branches/Kolibri-acpi/network/ARP.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; ARP.INC ;; @@ -293,13 +293,10 @@ ARP_input: DEBUGF DEBUG_NETWORK_VERBOSE, "ARP_input: IP address conflict detected!\n" .exit: - call NET_packet_free - add esp, 4 ; pop (balance stack) - DEBUGF DEBUG_NETWORK_VERBOSE, "ARP_input: exiting\n" + call NET_BUFF_free ret - ;--------------------------------------------------------------------------- ; ; ARP_output_request @@ -347,7 +344,7 @@ ARP_output_request: movsd ; popd [edi] ; DestIP - push edx eax + push eax call [ebx + NET_DEVICE.transmit] ret diff --git a/kernel/branches/Kolibri-acpi/network/IPv4.inc b/kernel/branches/Kolibri-acpi/network/IPv4.inc index 18acc53d97..b4a9ebcb86 100644 --- a/kernel/branches/Kolibri-acpi/network/IPv4.inc +++ b/kernel/branches/Kolibri-acpi/network/IPv4.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; IPv4.INC ;; @@ -16,7 +16,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 3515 $ +$Revision: 5522 $ IPv4_MAX_FRAGMENTS = 64 IPv4_MAX_ROUTES = 64 @@ -225,10 +225,10 @@ macro IPv4_checksum ptr { align 4 IPv4_input: ; TODO: add IPv4 raw sockets support - DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input, packet from: %u.%u.%u.%u ",\ + DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: packet from %u.%u.%u.%u ",\ [edx + IPv4_header.SourceAddress + 0]:1,[edx + IPv4_header.SourceAddress + 1]:1,\ [edx + IPv4_header.SourceAddress + 2]:1,[edx + IPv4_header.SourceAddress + 3]:1 - DEBUGF DEBUG_NETWORK_VERBOSE, "to: %u.%u.%u.%u\n",\ + DEBUGF DEBUG_NETWORK_VERBOSE, "to %u.%u.%u.%u\n",\ [edx + IPv4_header.DestinationAddress + 0]:1,[edx + IPv4_header.DestinationAddress + 1]:1,\ [edx + IPv4_header.DestinationAddress + 2]:1,[edx + IPv4_header.DestinationAddress + 3]:1 @@ -323,8 +323,7 @@ IPv4_input: ; TODO: add IPv4 .dump: DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: dumping\n" inc [IPv4_packets_dumped] ; FIXME: use correct interface - call NET_packet_free - add esp, 4 ; pop (balance stack) + call NET_BUFF_free ret @@ -371,7 +370,6 @@ IPv4_input: ; TODO: add IPv4 mov [eax + IPv4_FRAGMENT_entry.PrevPtr], edi mov [eax + IPv4_FRAGMENT_entry.Owner], ebx - add esp, 4 ret @@ -405,7 +403,6 @@ IPv4_input: ; TODO: add IPv4 mov [eax + IPv4_FRAGMENT_entry.PrevPtr], -1 mov [eax + IPv4_FRAGMENT_entry.Owner], ebx - add esp, 4 ; balance stack and exit ret @@ -506,7 +503,7 @@ IPv4_input: ; TODO: add IPv4 push [edx + IPv4_FRAGMENT_entry.NextPtr] ; Set edx to the next pointer push edx ; Push pointer to fragment onto stack DEBUGF DEBUG_NETWORK_VERBOSE, "IPv4_input: Next Fragment: 0x%x\n", edx - call NET_packet_free ; free the previous fragment buffer (this uses the value from stack) + call NET_BUFF_free ; free the previous fragment buffer (this uses the value from stack) pop edx ebx eax cmp edx, -1 ; Check if it is last fragment in chain jne .rebuild_packet_loop @@ -574,7 +571,7 @@ IPv4_find_fragment_slot: ; IN: eax = Destination IP ; ecx = data length ; edx = Source IP -; di = TTL shl 8 + protocol +; di = TTL shl 8 + protocol ; ; OUT: eax = pointer to buffer start / 0 on error ; ebx = device ptr (send packet through this device) @@ -654,7 +651,7 @@ IPv4_output: ret .loopback: - mov dword [esp + 2], eax ; change source IP to dest IP + mov dword [esp], eax ; set source IP to dest IP mov ecx, [esp + 10] add ecx, sizeof.IPv4_header mov edi, AF_INET4 @@ -749,7 +746,6 @@ IPv4_output_raw: ; ; ; IN: dword [esp] = pointer to buffer containing ipv4 packet to be fragmented -; dword [esp+4] = buffer size ; esi = pointer to ip header in that buffer ; ecx = max size of fragments ; @@ -857,9 +853,7 @@ IPv4_fragment: add esp, 12 + 4 + 6 .err2: DEBUGF DEBUG_NETWORK_VERBOSE, "Ipv4_fragment: dumping\n" - call NET_packet_free - add esp, 4 - + call NET_BUFF_free ret diff --git a/kernel/branches/Kolibri-acpi/network/IPv6.inc b/kernel/branches/Kolibri-acpi/network/IPv6.inc index f058ec639d..93bcdd1ab3 100644 --- a/kernel/branches/Kolibri-acpi/network/IPv6.inc +++ b/kernel/branches/Kolibri-acpi/network/IPv6.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2012-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2012-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; IPv6.INC ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 3251 $ +$Revision: 5522 $ struct IPv6_header @@ -147,9 +147,7 @@ IPv6_input: .dump: DEBUGF DEBUG_NETWORK_VERBOSE, "IPv6_input - dumping\n" - call kernel_free - add esp, 4 - + call NET_BUFF_free ret .dump_options: diff --git a/kernel/branches/Kolibri-acpi/network/PPPoE.inc b/kernel/branches/Kolibri-acpi/network/PPPoE.inc index f67167b4c3..eecbd0b4a8 100644 --- a/kernel/branches/Kolibri-acpi/network/PPPoE.inc +++ b/kernel/branches/Kolibri-acpi/network/PPPoE.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2012-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2012-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; PPPoE.INC ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 5015 $ +$Revision: 5522 $ struct PPPoE_frame @@ -106,8 +106,7 @@ PPPoE_discovery_input: popa DEBUGF DEBUG_NETWORK_VERBOSE, 'PPPoE_discovery_input: dumping\n' - call NET_packet_free - add esp, 4 + call NET_BUFF_free ret @@ -232,13 +231,11 @@ PPPoE_session_input: .dump: DEBUGF DEBUG_NETWORK_VERBOSE, "PPPoE_input: dumping\n" - call NET_packet_free - add esp, 4 + call NET_BUFF_free ret - ;----------------------------------------------------------------- ; ; PPPoE_output diff --git a/kernel/branches/Kolibri-acpi/network/ethernet.inc b/kernel/branches/Kolibri-acpi/network/ethernet.inc index b688543407..60a435cdc5 100644 --- a/kernel/branches/Kolibri-acpi/network/ethernet.inc +++ b/kernel/branches/Kolibri-acpi/network/ethernet.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; ETHERNET.INC ;; @@ -33,30 +33,25 @@ struct ETH_DEVICE NET_DEVICE ends -struct ETH_queue_entry - - device dd ? - packet dd ? - size dd ? - -ends - iglobal align 4 - ETH_BROADCAST dp 0xffffffffffff + ETH_BROADCAST dp 0xffffffffffff + + ETH_frame_queued dd 0 ; Number of queued frames + + ETH_frame_head dd ETH_frame_head ; Pointer to next frame in the linked list + ETH_frame_tail dd ETH_frame_head ; Pointer to last frame in the linked list + endg uglobal align 4 ETH_input_event dd ? - ETH_queue rd (ETH_QUEUE_SIZE*sizeof.ETH_queue_entry + sizeof.queue)/4 endg macro ETH_init { - init_queue ETH_queue - movi ebx, 1 mov ecx, ETH_process_input call new_sys_threads @@ -72,23 +67,36 @@ macro ETH_init { ; ETH_input ; ; This function is called by ethernet drivers, -; It pushes the received ethernet packets onto the eth_in_queue +; It pushes the received ethernet packets onto the ethernet input queue ; ; IN: [esp] = Pointer to buffer -; [esp+4] = size of buffer -; ebx = pointer to eth_device +; ; OUT: / ; ;----------------------------------------------------------------- align 4 ETH_input: - push ebx - mov esi, esp + pop eax + pushf + cli - add_to_queue ETH_queue, ETH_QUEUE_SIZE, sizeof.ETH_queue_entry, .fail - add esp, sizeof.ETH_queue_entry + cmp [ETH_frame_queued], ETH_QUEUE_SIZE + jae .full + inc [ETH_frame_queued] +; Add frame to the end of the linked list + mov [eax + NET_BUFF.NextPtr], ETH_frame_head + + mov ebx, [ETH_frame_tail] + mov [eax + NET_BUFF.PrevPtr], ebx + + mov [ETH_frame_tail], eax + mov [ebx + NET_BUFF.NextPtr], eax + + popf + +; Now queue an event to process it xor edx, edx mov eax, [ETH_input_event] mov ebx, [eax + EVENT.id] @@ -97,13 +105,11 @@ ETH_input: ret - .fail: + .full: DEBUGF DEBUG_NETWORK_ERROR, "ETH incoming queue is full, discarding packet!\n" - - pop ebx - call NET_packet_free - add esp, 4 - + popf + push eax + call NET_BUFF_free ret @@ -116,29 +122,46 @@ ETH_process_input: mov ecx, MANUAL_DESTROY call create_event mov [ETH_input_event], eax - + pushf .wait: + popf mov eax, [ETH_input_event] mov ebx, [eax + EVENT.id] call wait_event .loop: - get_from_queue ETH_queue, ETH_QUEUE_SIZE, sizeof.ETH_queue_entry, .wait + pushf + cli + cmp [ETH_frame_queued], 0 + je .wait - mov eax, [esi + ETH_queue_entry.packet] - mov ecx, [esi + ETH_queue_entry.size] - mov ebx, [esi + ETH_queue_entry.device] + dec [ETH_frame_queued] - pushd .loop ; return address - push ecx eax + mov esi, [ETH_frame_head] + mov ebx, [esi + NET_BUFF.NextPtr] + + mov [ETH_frame_head], ebx + mov [ebx + NET_BUFF.PrevPtr], ETH_frame_head + + popf + + mov eax, [esi + NET_BUFF.offset] + add eax, esi + mov ecx, [esi + NET_BUFF.length] + mov ebx, [esi + NET_BUFF.device] + + pushd .loop ; return address for protocol handler + push esi ; keep pointer to NET_BUFF on stack DEBUGF DEBUG_NETWORK_VERBOSE, "ETH_input: size=%u\n", ecx sub ecx, sizeof.ETH_header jb .dump +; Set registers for protocol handlers lea edx, [eax + sizeof.ETH_header] mov ax, [eax + ETH_header.Type] +; Place protocol handlers here cmp ax, ETHER_PROTO_IPv4 je IPv4_input @@ -158,8 +181,7 @@ ETH_process_input: .dump: DEBUGF DEBUG_NETWORK_VERBOSE, "ETH_input: dumping\n" - call NET_packet_free - add esp, 4 + call NET_BUFF_free ret ;----------------------------------------------------------------- @@ -171,11 +193,10 @@ ETH_process_input: ; ecx = payload size ; edx = pointer to destination mac ; -; OUT: eax = start of ethernet frame / 0 on error +; OUT: eax = start of net frame / 0 on error ; ebx = device ptr ; ecx = payload size -; edx = ethernet frame size -; edi = start of ethernet payload +; edi = start of payload ; ;----------------------------------------------------------------- align 4 @@ -189,11 +210,14 @@ ETH_output: push ecx push ax edx - add ecx, sizeof.ETH_header - stdcall kernel_alloc, ecx + add ecx, sizeof.ETH_header + NET_BUFF.data + stdcall NET_BUFF_alloc, ecx test eax, eax jz .out_of_ram - mov edi, eax + mov [eax + NET_BUFF.type], NET_BUFF_ETH + mov [eax + NET_BUFF.device], ebx + mov [eax + NET_BUFF.offset], NET_BUFF.data + lea edi, [eax + NET_BUFF.data] pop esi movsd @@ -204,13 +228,14 @@ ETH_output: pop ax stosw - lea eax, [edi - sizeof.ETH_header] ; Set eax to buffer start + lea eax, [edi - sizeof.ETH_header - NET_BUFF.data] ; Set eax to buffer start pop ecx - lea edx, [ecx + sizeof.ETH_header] ; Set edx to complete buffer size + lea edx, [ecx + sizeof.ETH_header] ; Set edx to complete buffer size cmp edx, ETH_FRAME_MINIMUM jbe .adjust_size .done: + mov [eax + NET_BUFF.length], edx DEBUGF DEBUG_NETWORK_VERBOSE, "ETH_output: ptr=%x size=%u\n", eax, edx ret @@ -272,7 +297,7 @@ ETH_api: .read_mac: movzx ebx, word [eax + ETH_DEVICE.mac] mov eax, dword [eax + ETH_DEVICE.mac + 2] - mov [esp+20+4], ebx ; TODO: fix this ugly code + mov [esp+20+4], ebx ; FIXME ret diff --git a/kernel/branches/Kolibri-acpi/network/icmp.inc b/kernel/branches/Kolibri-acpi/network/icmp.inc index fea37bec91..607ecd2b59 100644 --- a/kernel/branches/Kolibri-acpi/network/icmp.inc +++ b/kernel/branches/Kolibri-acpi/network/icmp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; ICMP.INC ;; @@ -131,7 +131,6 @@ macro ICMP_init { ; and insert packets into sockets when needed ; ; IN: Pointer to buffer in [esp] -; size of buffer in [esp+4] ; ebx = pointer to device struct ; ecx = ICMP Packet size ; esi = ptr to ICMP Packet data @@ -143,10 +142,9 @@ macro ICMP_init { align 4 ICMP_input: - DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP_input:\n" - -; First, check the checksum (altough some implementations ignore it) + DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP_input\n" +; Check the checksum push esi ecx push [esi + ICMP_header.Checksum] mov [esi + ICMP_header.Checksum], 0 @@ -155,100 +153,34 @@ ICMP_input: call checksum_2 pop si cmp dx, si - pop ecx edx + pop ecx esi jne .checksum_mismatch -; Check packet type + DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP_input: Checksum OK\n" - cmp [edx + ICMP_header.Type], ICMP_ECHO ; Is this an echo request? - jne .check_sockets - -; Update stats (and validate device ptr) +; Ualidate device ptr + mov eax, edi call NET_ptr_to_num4 cmp edi, -1 je .dump + +; Update stats inc [ICMP_PACKETS_RX + edi] -; We well re-use the packet so we can create the response as fast as possible -; Notice: this only works on pure ethernet - - DEBUGF DEBUG_NETWORK_VERBOSE, "got echo request\n" - mov [edx + ICMP_header.Type], ICMP_ECHOREPLY ; Change Packet type to reply - - mov esi, [esp] ; Start of buffer - cmp ebx, LOOPBACK_DEVICE - je .loopback - -; FIXME: dont assume device is an ethernet device! - -; exchange dest and source address in IP header -; exchange dest and source MAC in ETH header - push dword [esi + ETH_header.DstMAC] - push dword [esi + ETH_header.SrcMAC] - pop dword [esi + ETH_header.DstMAC] - pop dword [esi + ETH_header.SrcMAC] - push word [esi + ETH_header.DstMAC + 4] - push word [esi + ETH_header.SrcMAC + 4] - pop word [esi + ETH_header.DstMAC + 4] - pop word [esi + ETH_header.SrcMAC + 4] - add esi, sizeof.ETH_header-4 - - .loopback: - add esi, 4 - push [esi + IPv4_header.SourceAddress] - push [esi + IPv4_header.DestinationAddress] - pop [esi + IPv4_header.SourceAddress] - pop [esi + IPv4_header.DestinationAddress] - -; Recalculate ip header checksum - movzx ecx, [esi + IPv4_header.VersionAndIHL] ; Calculate IP Header length by using IHL field - and ecx, 0x0f - shl cx, 2 - mov edi, ecx ; IP header length - mov eax, edx ; ICMP packet start addr - - push esi ; Calculate the IP checksum - xor edx, edx ; - call checksum_1 ; - call checksum_2 ; - pop esi ; - mov [esi + IPv4_header.HeaderChecksum], dx ; - -; Recalculate ICMP CheckSum - movzx ecx, [esi + IPv4_header.TotalLength] ; Find length of IP Packet - xchg ch, cl ; - sub ecx, edi ; IP packet length - IP header length = ICMP packet length - - mov esi, eax ; Calculate ICMP checksum - xor edx, edx ; - call checksum_1 ; - call checksum_2 ; - mov [eax + ICMP_header.Checksum], dx ; - -; Transmit the packet (notice that packet ptr and packet size have been on stack since start of the procedure!) - call [ebx + NET_DEVICE.transmit] - test eax, eax - jnz @f - call NET_ptr_to_num4 - inc [ICMP_PACKETS_TX + edi] - @@: - ret - - - - - .check_sockets: - ; Look for an open ICMP socket +; Is this an echo request? + cmp [esi + ICMP_header.Type], ICMP_ECHO + je .echo_request +; Look for an open ICMP socket pusha mov ecx, socket_mutex call mutex_lock popa - mov esi, [edi] ; ipv4 source address + mov edx, [eax] ; ipv4 source address mov eax, net_sockets .try_more: -; mov , [edx + ICMP_header.Identifier] +; mov , [esi + ICMP_header.Identifier] .next_socket: mov eax, [eax + SOCKET.NextPtr] or eax, eax @@ -260,18 +192,12 @@ ICMP_input: cmp [eax + SOCKET.Protocol], IP_PROTO_ICMP jne .next_socket - cmp [eax + IP_SOCKET.RemoteIP], esi + cmp [eax + IP_SOCKET.RemoteIP], edx jne .next_socket ; cmp [eax + ICMP_SOCKET.Identifier], ; jne .next_socket -; Update stats (and validate device ptr) - call NET_ptr_to_num4 - cmp edi, -1 - je .dump_ - inc [ICMP_PACKETS_RX + edi] - pusha mov ecx, socket_mutex call mutex_unlock @@ -284,11 +210,82 @@ ICMP_input: call mutex_lock popa - mov esi, edx jmp SOCKET_input - .dump_: + + .echo_request: + +; We'll reuse the packet so we can create the response as fast as possible + DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP echo request\n" + +; Change Packet type to reply + mov [esi + ICMP_header.Type], ICMP_ECHOREPLY + + mov eax, [esp] + lea esi, [eax + NET_BUFF.data] + +; Check frame type + cmp [eax + NET_BUFF.type], NET_BUFF_ETH + jne .not_ethernet + +; exchange dest and source MAC in ETH header + push dword [esi + ETH_header.DstMAC] + push dword [esi + ETH_header.SrcMAC] + pop dword [esi + ETH_header.DstMAC] + pop dword [esi + ETH_header.SrcMAC] + push word [esi + ETH_header.DstMAC + 4] + push word [esi + ETH_header.SrcMAC + 4] + pop word [esi + ETH_header.DstMAC + 4] + pop word [esi + ETH_header.SrcMAC + 4] + add esi, sizeof.ETH_header + + .not_ethernet: +; Exchange dest and source address in IP header + push [esi + IPv4_header.SourceAddress] + push [esi + IPv4_header.DestinationAddress] + pop [esi + IPv4_header.SourceAddress] + pop [esi + IPv4_header.DestinationAddress] + +; Calculate IP header length + movzx ecx, [esi + IPv4_header.VersionAndIHL] + and ecx, 0x0f + shl cx, 2 + mov edi, ecx ; put it in edi for later + +; Calculate IP checksum + mov eax, esi + mov [eax + IPv4_header.HeaderChecksum], 0 + xor edx, edx + call checksum_1 + call checksum_2 + mov [eax + IPv4_header.HeaderChecksum], dx + +; Calculate ICMP packet length + movzx ecx, [eax + IPv4_header.TotalLength] + xchg ch, cl + sub ecx, edi ; IP packet length - IP header length = ICMP packet length + +; Calculate ICMP checkSum + mov eax, esi + mov [esi + ICMP_header.Checksum], 0 + xor edx, edx + call checksum_1 + call checksum_2 + mov [eax + ICMP_header.Checksum], dx + +; Transmit the frame + DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP transmitting reply\n" + call [ebx + NET_DEVICE.transmit] + test eax, eax + jnz @f + DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP transmit failed\n" + call NET_ptr_to_num4 + inc [ICMP_PACKETS_TX + edi] + @@: + ret + + .dump_: pusha mov ecx, socket_mutex call mutex_unlock @@ -297,16 +294,12 @@ ICMP_input: DEBUGF DEBUG_NETWORK_ERROR, "ICMP_input: no socket found\n" jmp .dump - .checksum_mismatch: DEBUGF DEBUG_NETWORK_ERROR, "ICMP_input: checksum mismatch\n" .dump: DEBUGF DEBUG_NETWORK_VERBOSE, "ICMP_input: dumping\n" - - call NET_packet_free - add esp, 4 ; pop (balance stack) - + call NET_BUFF_free ret @@ -400,7 +393,6 @@ ICMP_output_raw: jz .exit pop esi - push edx push eax push edi ecx @@ -426,7 +418,6 @@ ICMP_output_raw: ret .exit: DEBUGF DEBUG_NETWORK_ERROR, "Creating ICMP Packet failed\n" - add esp, 4 ret diff --git a/kernel/branches/Kolibri-acpi/network/loopback.inc b/kernel/branches/Kolibri-acpi/network/loopback.inc index 72eeb76db0..eca4c5d90d 100644 --- a/kernel/branches/Kolibri-acpi/network/loopback.inc +++ b/kernel/branches/Kolibri-acpi/network/loopback.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; loopback.inc ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 2891 $ +$Revision: 5523 $ iglobal align 4 @@ -66,54 +66,56 @@ local .fail ; LOOP_input ; ; IN: [esp+4] = Pointer to buffer -; [esp+8] = size of buffer ; ; OUT: / ; ;----------------------------------------------------------------- align 4 LOOP_input: - pop ebx - pop eax - pop ecx - push ebx - push ecx - push eax + mov eax, [esp+4] +; Update stats inc [LOOPBACK_DEVICE.packets_rx] + + mov ecx, [eax + NET_BUFF.length] add dword[LOOPBACK_DEVICE.bytes_rx], ecx adc dword[LOOPBACK_DEVICE.bytes_rx + 4], 0 - DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_input: size=%u\n", ecx - lea edx, [eax + 4] - mov eax, dword[eax] - mov ebx, LOOPBACK_DEVICE + DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_input: ptr=%x size=%u\n", eax, ecx +; Reverse buffptr and returnaddr on stack + pop edx edi + push edx edi + +; Set registers for protocol handlers + lea edx, [eax + NET_BUFF.data] + mov ebx, [eax + NET_BUFF.device] + mov eax, [eax + NET_BUFF.type] + +; Place protocol handlers here cmp eax, AF_INET4 je IPv4_input - DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_input: Unknown packet type=%x\n", ax + DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_input: Unknown packet type=%x\n", eax .dump: DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_input: dumping\n" - call NET_packet_free - add esp, 4 + call NET_BUFF_free ret + ;----------------------------------------------------------------- ; ; LOOP_output ; -; IN: -; ecx = packet size +; IN: ecx = packet size ; edi = address family ; -; OUT: edi = 0 on error, pointer to buffer otherwise -; eax = buffer start +; OUT: eax = start of net frame / 0 on error ; ebx = to device structure ; ecx = unchanged (packet size of embedded data) -; edx = size of complete buffer +; edi = start of payload ; ;----------------------------------------------------------------- align 4 @@ -121,35 +123,39 @@ LOOP_output: DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_output\n" - push ecx - push edi - - add ecx, 4 cmp ecx, [LOOPBACK_DEVICE.mtu] - ja .out_of_ram - stdcall kernel_alloc, ecx + ja .too_large + + push ecx edi + add ecx, NET_BUFF.data + stdcall NET_BUFF_alloc, ecx test eax, eax jz .out_of_ram - mov edi, eax - pop eax - stosd - lea eax, [edi - 4] ; Set eax to buffer start - pop ecx - lea edx, [ecx + 4] ; Set edx to complete buffer size + pop edi + mov [eax + NET_BUFF.type], edi mov ebx, LOOPBACK_DEVICE + mov [eax + NET_BUFF.device], ebx + pop ecx + mov [eax + NET_BUFF.length], ecx + lea edi, [eax + NET_BUFF.data] inc [LOOPBACK_DEVICE.packets_tx] add dword[LOOPBACK_DEVICE.bytes_tx], ecx adc dword[LOOPBACK_DEVICE.bytes_tx + 4], 0 - DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_output: ptr=%x size=%u\n", eax, edx + DEBUGF DEBUG_NETWORK_VERBOSE, "LOOP_output: ptr=%x size=%u\n", eax, ecx + ret + + .too_large: + DEBUGF DEBUG_NETWORK_ERROR, "LOOP_output: packet is too large\n" + xor eax, eax ret .out_of_ram: DEBUGF DEBUG_NETWORK_ERROR, "LOOP_output: out of memory\n" add esp, 4+4 - xor edi, edi + xor eax, eax ret diff --git a/kernel/branches/Kolibri-acpi/network/queue.inc b/kernel/branches/Kolibri-acpi/network/queue.inc index 09955e5639..7177adc35c 100644 --- a/kernel/branches/Kolibri-acpi/network/queue.inc +++ b/kernel/branches/Kolibri-acpi/network/queue.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2010. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; queue.inc ;; diff --git a/kernel/branches/Kolibri-acpi/network/socket.inc b/kernel/branches/Kolibri-acpi/network/socket.inc index 8da38da169..33ab90f12f 100644 --- a/kernel/branches/Kolibri-acpi/network/socket.inc +++ b/kernel/branches/Kolibri-acpi/network/socket.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -98,9 +98,9 @@ struct TCP_SOCKET IP_SOCKET ;---------------------- ; Transmit timing stuff t_idle dd ? - t_rtt dd ? + t_rtt dd ? ; round trip time t_rtseq dd ? - t_srtt dd ? + t_srtt dd ? ; smoothed round trip time t_rttvar dd ? t_rttmin dd ? max_sndwnd dd ? @@ -179,8 +179,8 @@ ends struct socket_queue_entry data_ptr dd ? - buf_ptr dd ? data_size dd ? + buf_ptr dd ? ends @@ -754,7 +754,7 @@ SOCKET_receive: pop edi test [eax + SOCKET.state], SS_CANTRCVMORE - jnz .return + jnz .last_data cmp ebx, EWOULDBLOCK jne .return @@ -779,6 +779,11 @@ SOCKET_receive: mov [esp+32], ecx ret + .last_data: + test ecx, ecx + jz .return + call SOCKET_notify + jmp .return @@ -817,7 +822,7 @@ SOCKET_receive_dgram: rep movsd .nd: - call NET_packet_free + call NET_BUFF_free pop ecx eax ; return number of bytes copied to application xor ebx, ebx ret @@ -874,6 +879,13 @@ SOCKET_receive_stream: call SOCKET_ring_free ; free read memory pop eax + cmp [eax + STREAM_SOCKET.rcv + RING_BUFFER.size], 0 + jne .more_data + xor ebx, ebx ; errorcode = 0 (no error) + ret + + .more_data: + call SOCKET_notify ; Queue another network event xor ebx, ebx ; errorcode = 0 (no error) ret @@ -1429,7 +1441,6 @@ SOCKET_check_port: ; ecx = data size ; esi = ptr to data ; [esp] = ptr to buf -; [esp + 4] = buf size ; ; OUT: / ; @@ -1439,7 +1450,7 @@ SOCKET_input: DEBUGF DEBUG_NETWORK_VERBOSE, "SOCKET_input: socket=%x, data=%x size=%u\n", eax, esi, ecx - mov [esp+4], ecx + push ecx push esi mov esi, esp @@ -1463,16 +1474,13 @@ SOCKET_input: call mutex_unlock popa - call NET_packet_free - add esp, 8 - + call NET_BUFF_free ret ;-------------------------- ; -; IN: eax = ptr to ring struct (just a buffer of the right size) -; OUT: eax = unchanged / 0 on error +; eax = ptr to ring struct (just a buffer of the right size) ; align 4 SOCKET_ring_create: @@ -1481,7 +1489,7 @@ SOCKET_ring_create: mov esi, eax push edx - stdcall create_ring_buffer, SOCKET_MAXDATA, PG_SW + stdcall create_ring_buffer, SOCKET_MAXDATA, PG_SWR pop edx test eax, eax jz .fail @@ -1962,14 +1970,8 @@ SOCKET_free: jnz .no_tcp mov ebx, eax - cmp [ebx + STREAM_SOCKET.rcv.start_ptr], 0 - je @f stdcall kernel_free, [ebx + STREAM_SOCKET.rcv.start_ptr] - @@: - cmp [ebx + STREAM_SOCKET.snd.start_ptr], 0 - je @f stdcall kernel_free, [ebx + STREAM_SOCKET.snd.start_ptr] - @@: mov eax, ebx .no_tcp: @@ -2407,4 +2409,4 @@ SOCKET_cant_send_more: .notconn: mov dword[esp+20], ENOTCONN mov dword[esp+32], -1 - ret \ No newline at end of file + ret diff --git a/kernel/branches/Kolibri-acpi/network/stack.inc b/kernel/branches/Kolibri-acpi/network/stack.inc index 6f121aa799..fb3249edfb 100644 --- a/kernel/branches/Kolibri-acpi/network/stack.inc +++ b/kernel/branches/Kolibri-acpi/network/stack.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; STACK.INC ;; @@ -32,6 +32,8 @@ DEBUG_NETWORK_ERROR = 1 DEBUG_NETWORK_VERBOSE = 0 NET_DEVICES_MAX = 16 +NET_BUFFERS = 512 +NET_BUFFER_SIZE = 2048 ARP_BLOCK = 1 ; true or false EPHEMERAL_PORT_MIN = 49152 @@ -146,7 +148,7 @@ NET_DEVICE_ETH = 1 NET_DEVICE_SLIP = 2 ; Network link types (link protocols) -NET_LINK_LOOPBACK = 0 ;;; Really a link type? +NET_LINK_LOOPBACK = 0 NET_LINK_MAC = 1 ; Media access control (ethernet, isdn, ...) NET_LINK_PPP = 2 ; Point to Point Protocol (PPPoE, ...) NET_LINK_IEEE802.11 = 3 ; IEEE 802.11 (WiFi) @@ -155,6 +157,10 @@ NET_LINK_IEEE802.11 = 3 ; IEEE 802.11 (WiFi) NET_HWACC_TCP_IPv4_IN = 1 shl 0 NET_HWACC_TCP_IPv4_OUT = 1 shl 1 +; Network frame types +NET_BUFF_LOOPBACK = 0 +NET_BUFF_ETH = 1 + struct NET_DEVICE device_type dd ? ; Type field @@ -175,6 +181,18 @@ struct NET_DEVICE ends +struct NET_BUFF + + NextPtr dd ? ; pointer to next frame in list + PrevPtr dd ? ; pointer to previous frame in list + device dd ? ; ptr to NET_DEVICE structure + type dd ? ; encapsulation type: e.g. Ethernet + length dd ? ; size of encapsulated data + offset dd ? ; offset to actual data (24 bytes for default frame) + data rb 0 + +ends + ; Exactly as it says.. macro pseudo_random reg { @@ -226,8 +244,11 @@ include "socket.inc" uglobal align 4 - NET_RUNNING dd ? - NET_DRV_LIST rd NET_DEVICES_MAX + NET_RUNNING dd ? + NET_DRV_LIST rd NET_DEVICES_MAX + + NET_BUFFS_FREE rd NET_BUFFERS + .current dd ? endg @@ -245,10 +266,27 @@ endg align 4 stack_init: +; allocate network buffers + stdcall kernel_alloc, NET_BUFFER_SIZE*NET_BUFFERS + test eax, eax + jz .fail + + mov edi, NET_BUFFS_FREE + mov ecx, NET_BUFFERS + cld + .loop: + stosd + add eax, NET_BUFFER_SIZE + dec ecx + jnz .loop + + mov eax, NET_BUFFS_FREE + stosd + ; Init the network drivers list xor eax, eax mov edi, NET_RUNNING - mov ecx, (NET_DEVICES_MAX + 2) + mov ecx, (NET_DEVICES_MAX + 1) rep stosd ETH_init @@ -268,7 +306,10 @@ stack_init: LOOP_init mov [net_tmr_count], 0 + ret + .fail: + DEBUGF DEBUG_NETWORK_ERROR, "Stack init failed!\n" ret @@ -327,9 +368,53 @@ stack_handler: align 4 -NET_packet_free: - and dword[esp+4], not 0xfff - jmp kernel_free +proc NET_BUFF_alloc stdcall, buffersize + cmp [buffersize], NET_BUFFER_SIZE + ja .too_large + + spin_lock_irqsave + + mov eax, [NET_BUFFS_FREE.current] + cmp eax, NET_BUFFS_FREE+NET_BUFFERS*4 + jae .out_of_mem + mov eax, [eax] + add [NET_BUFFS_FREE.current], 4 + + spin_unlock_irqrestore + + DEBUGF DEBUG_NETWORK_VERBOSE, "net alloc: 0x%x\n", eax + ret + + .out_of_mem: + spin_unlock_irqrestore + + xor eax, eax + DEBUGF DEBUG_NETWORK_ERROR, "NET_BUFF_alloc: out of mem!\n" + ret + + .too_large: + xor eax, eax + DEBUGF DEBUG_NETWORK_ERROR, "NET_BUFF_alloc: too large!\n" + ret +endp + + +align 4 +proc NET_BUFF_free stdcall, buffer + + DEBUGF DEBUG_NETWORK_VERBOSE, "net free: 0x%x\n", [buffer] + + spin_lock_irqsave + + sub [NET_BUFFS_FREE.current], 4 + mov eax, [NET_BUFFS_FREE.current] + push [buffer] + pop dword[eax] + + spin_unlock_irqrestore + + ret +endp align 4 @@ -482,8 +567,10 @@ NET_ptr_to_num: align 4 NET_ptr_to_num4: ; Todo, place number in device structure so we only need to verify? - push ecx + test ebx, ebx + jz .fail + push ecx mov ecx, NET_DEVICES_MAX mov edi, NET_DRV_LIST .loop: @@ -493,8 +580,9 @@ NET_ptr_to_num4: ; Todo, place number in device structure so we o dec ecx jnz .loop - or edi, -1 pop ecx + .fail: + or edi, -1 ret .found: diff --git a/kernel/branches/Kolibri-acpi/network/tcp.inc b/kernel/branches/Kolibri-acpi/network/tcp.inc index 82f29f244c..b4c8fce060 100644 --- a/kernel/branches/Kolibri-acpi/network/tcp.inc +++ b/kernel/branches/Kolibri-acpi/network/tcp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -124,9 +124,8 @@ struct TCP_queue_entry segment_ptr dd ? segment_size dd ? device_ptr dd ? - - buffer_ptr dd ? timestamp dd ? + buffer_ptr dd ? ends diff --git a/kernel/branches/Kolibri-acpi/network/tcp_input.inc b/kernel/branches/Kolibri-acpi/network/tcp_input.inc index 79625d160c..2c554c5eba 100644 --- a/kernel/branches/Kolibri-acpi/network/tcp_input.inc +++ b/kernel/branches/Kolibri-acpi/network/tcp_input.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 5155 $ +$Revision: 5522 $ ;----------------------------------------------------------------- ; @@ -23,7 +23,6 @@ $Revision: 5155 $ ; Add a segment to the incoming TCP queue ; ; IN: [esp] = ptr to buffer -; [esp+4] = buffer size (dont care) ; ebx = ptr to device struct ; ecx = segment size ; esi = ptr to TCP segment @@ -37,10 +36,8 @@ align 4 TCP_input: ; record the current time - mov eax, [timer_ticks] ; in 1/100 seconds - mov [esp + 4], eax - - push ebx ecx esi edi ; mind the order + push [timer_ticks] ; in 1/100 seconds + push ebx ecx esi edi ; mind the order (see TCP_queue_entry struct) mov esi, esp add_to_queue TCP_queue, TCP_QUEUE_SIZE, sizeof.TCP_queue_entry, .fail @@ -64,14 +61,11 @@ TCP_input: inc [TCP_segments_missed + edi] add esp, sizeof.TCP_queue_entry - 8 - call NET_packet_free - add esp, 4 - + call NET_BUFF_free ret - align 4 proc TCP_process_input @@ -394,13 +388,18 @@ endl pop ecx cmp eax, TCP_PAWS_IDLE - jle .drop_after_ack ; TODO: update stats + jle .paws_drop push ecx - mov [ebx + TCP_SOCKET.ts_recent], 0 ; timestamp was invalid, fix it. .no_paws: jmp .opt_loop + .paws_drop: + inc [TCPS_rcvduppack] ; update stats + add [TCPS_rcvdupbyte], ecx + inc [TCPS_pawsdrop] + jmp .drop_after_ack + .no_options: pop ecx @@ -630,6 +629,8 @@ endl or [ebx + TCP_SOCKET.t_flags], TF_ACKNOW mov eax, ecx + inc [TCPS_rcvpartduppack] + ;;; TODO: update stats ;----------------------------------------------- @@ -662,7 +663,7 @@ endl mov eax, ebx call TCP_close -;;; TODO: update stats + inc [TCPS_rcvafterclose] jmp .respond_seg_reset ;---------------------------------------- @@ -985,17 +986,14 @@ endl mov eax, [edx + TCP_header.AckNumber] cmp eax, [ebx + TCP_SOCKET.SND_MAX] jbe @f - - ;;; TODO: update stats + inc [TCPS_rcvacktoomuch] jmp .drop_after_ack - @@: mov edi, [edx + TCP_header.AckNumber] sub edi, [ebx + TCP_SOCKET.SND_UNA] ; now we got the number of acked bytes in edi - - ;;; TODO: update stats - + inc [TCPS_rcvackpack] + add [TCPS_rcvackbyte], edi DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_input: acceptable ACK for %u bytes\n", edi ;------------------------------------------ @@ -1209,6 +1207,8 @@ align 4 test [edx + TCP_header.Flags], TH_SYN jz .drop + inc [TCPS_accepts] ; update stats + ;;; TODO: check if it's a broadcast or multicast, and drop if so push dword [edi] ; Ipv4 source addres @@ -1589,7 +1589,7 @@ align 4 .done: DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_input: dumping\n" - call NET_packet_free + call NET_BUFF_free jmp .loop @@ -1708,7 +1708,7 @@ align 4 .drop_no_socket: DEBUGF DEBUG_NETWORK_VERBOSE, "TCP_input: Drop (no socket)\n" - call NET_packet_free + call NET_BUFF_free jmp .loop endp diff --git a/kernel/branches/Kolibri-acpi/network/tcp_output.inc b/kernel/branches/Kolibri-acpi/network/tcp_output.inc index 037df19995..eb788537d0 100644 --- a/kernel/branches/Kolibri-acpi/network/tcp_output.inc +++ b/kernel/branches/Kolibri-acpi/network/tcp_output.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 3289 $ +$Revision: 5522 $ ;----------------------------------------------------------------- ; @@ -90,10 +90,9 @@ endl cmp ebx, [eax + STREAM_SOCKET.snd.size] jae @f - and dl, not (TH_FIN) - @@: + inc ecx jmp .no_force @@ -113,7 +112,6 @@ endl @@: sub esi, ebx - ;------------------------ ; check for window shrink (107) @@ -146,7 +144,6 @@ endl cmp esi, [eax + TCP_SOCKET.t_maxseg] jbe @f - mov esi, [eax + TCP_SOCKET.t_maxseg] or [temp_bits], TCP_BIT_SENDALOT @@: @@ -160,7 +157,6 @@ endl cmp edi, [eax + STREAM_SOCKET.snd.size] jae @f and dl, not (TH_FIN) - @@: ;------------------------------- @@ -403,6 +399,50 @@ endl or [temp_bits], TCP_BIT_SENDALOT .no_overflow: +; Update stats + test esi, esi + jz .zero_data + + cmp [eax + TCP_SOCKET.t_force], 1 + jne @f + cmp esi, 1 + jne @f + inc [TCPS_sndprobe] + jmp .eos + @@: + + mov ebx, [eax + TCP_SOCKET.SND_NXT] + cmp ebx, [eax + TCP_SOCKET.SND_MAX] + jae @f + inc [TCPS_sndrexmitpack] + add [TCPS_sndrexmitbyte], esi + jmp .eos + @@: + inc [TCPS_sndpack] + add [TCPS_sndbyte], esi + jmp .eos + + .zero_data: + test [eax + TCP_SOCKET.t_flags], TF_ACKNOW + jz @f + inc [TCPS_sndacks] + jmp .eos + @@: + test dl, TH_SYN + TH_FIN + TH_RST + jz @f + inc [TCPS_sndctrl] + jmp .eos + @@: + mov ebx, [eax + TCP_SOCKET.SND_UP] + cmp ebx, [eax + TCP_SOCKET.SND_UNA] + jb @f + inc [TCPS_sndurg] + jmp .eos + @@: + inc [TCPS_sndwinup] + + .eos: + ;---------------------------------------------------- ; Calculate the receive window. ; Dont shrink window, but avoid silly window syndrome @@ -469,8 +509,8 @@ endl call IPv4_output jz .ip_error -;----------------------------------------- -; Move TCP header from stack to TCP packet +;------------------------------------------ +; Move TCP header from stack to TCP segment push ecx mov ecx, [esp + 4] @@ -482,7 +522,6 @@ endl pop esi ; headersize add esp, esi ; remove it from stack - push edx ; packet size for send proc push eax ; packet ptr for send proc mov edx, edi ; begin of data @@ -497,14 +536,14 @@ endl ; ecx = buffer size ; edi = ptr to buffer - mov eax, [esp + 16] ; get socket ptr + mov eax, [esp + 12] ; get socket ptr push edx push [eax + TCP_SOCKET.SND_NXT] ; we'll need this for timing the transmission test ecx, ecx jz .nodata mov edx, [eax + TCP_SOCKET.SND_NXT] - add [eax + TCP_SOCKET.SND_NXT], ecx ; update sequence number <<< CHECKME + add [eax + TCP_SOCKET.SND_NXT], ecx ; update sequence number sub edx, [eax + TCP_SOCKET.SND_UNA] ; offset add eax, STREAM_SOCKET.snd call SOCKET_ring_read @@ -512,7 +551,7 @@ endl pop edi pop esi ; begin of data pop ecx ; full packet size - mov eax, [esp + 12] ; socket ptr + mov eax, [esp + 8] ; socket ptr ;---------------------------------- ; initialize retransmit timer (400) @@ -536,7 +575,7 @@ endl je @f mov [eax + TCP_SOCKET.t_rtt], 1 ; nope, start transmission timer mov [eax + TCP_SOCKET.t_rtseq], edi -;TODO: update stats + inc [TCPS_segstimed] @@: ; set retransmission timer if not already set, and not doing an ACK or keepalive probe @@ -584,6 +623,7 @@ endl call NET_ptr_to_num4 inc [TCP_segments_tx + edi] + inc [TCPS_sndtotal] ; update advertised receive window test ecx, ecx diff --git a/kernel/branches/Kolibri-acpi/network/tcp_subr.inc b/kernel/branches/Kolibri-acpi/network/tcp_subr.inc index 63ef16b97b..9c435b1968 100644 --- a/kernel/branches/Kolibri-acpi/network/tcp_subr.inc +++ b/kernel/branches/Kolibri-acpi/network/tcp_subr.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 5015 $ +$Revision: 5522 $ align 4 iglobal @@ -292,7 +292,7 @@ TCP_respond: call IPv4_output jz .error pop esi cx - push edx eax + push eax ;----------------------------------------------- ; Fill in the TCP header by using the socket ptr @@ -376,7 +376,7 @@ TCP_respond_segment: jz .error pop esi cx - push edx eax + push eax ;--------------------------------------------------- ; Fill in the TCP header by using a received segment diff --git a/kernel/branches/Kolibri-acpi/network/tcp_timer.inc b/kernel/branches/Kolibri-acpi/network/tcp_timer.inc index 1b591e204a..3fee78754e 100644 --- a/kernel/branches/Kolibri-acpi/network/tcp_timer.inc +++ b/kernel/branches/Kolibri-acpi/network/tcp_timer.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 5013 $ +$Revision: 5442 $ timer_flag_retransmission = 1 shl 0 timer_flag_keepalive = 1 shl 1 @@ -54,6 +54,8 @@ local .exit ; call TCP_output ;; pop ebx + inc [TCPS_delack] ; update stats + jmp .loop .exit: diff --git a/kernel/branches/Kolibri-acpi/network/tcp_usreq.inc b/kernel/branches/Kolibri-acpi/network/tcp_usreq.inc index e26944022b..3bc533da2c 100644 --- a/kernel/branches/Kolibri-acpi/network/tcp_usreq.inc +++ b/kernel/branches/Kolibri-acpi/network/tcp_usreq.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2013. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; Part of the TCP/IP network stack for KolibriOS ;; @@ -14,7 +14,7 @@ ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -$Revision: 4850 $ +$Revision: 5442 $ ;------------------------- @@ -89,6 +89,8 @@ TCP_connect: test [eax + SOCKET.state], SS_ISCONNECTED jnz .eisconn + inc [TCPS_connattempt] ; update stats + push eax edx lea ecx, [eax + SOCKET.mutex] call mutex_lock diff --git a/kernel/branches/Kolibri-acpi/network/udp.inc b/kernel/branches/Kolibri-acpi/network/udp.inc index 6401563328..905030440f 100644 --- a/kernel/branches/Kolibri-acpi/network/udp.inc +++ b/kernel/branches/Kolibri-acpi/network/udp.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; UDP.INC ;; @@ -154,7 +154,7 @@ UDP_input: .next_socket: mov eax, [eax + SOCKET.NextPtr] or eax, eax - jz .dump_ + jz .unlock_dump cmp [eax + SOCKET.Domain], AF_INET4 jne .next_socket @@ -213,30 +213,25 @@ UDP_input: mov [eax + UDP_SOCKET.RemotePort], cx jmp .updatesock - .dump_: - + .unlock_dump: pusha mov ecx, socket_mutex call mutex_unlock popa DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: no socket found\n" - jmp .dump .checksum_mismatch: DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: checksum mismatch\n" .dump: - call NET_packet_free - add esp, 4 ; pop (balance stack) - DEBUGF DEBUG_NETWORK_VERBOSE,"UDP_input: dumping\n" - + DEBUGF DEBUG_NETWORK_VERBOSE, "UDP_input: dumping\n" + call NET_BUFF_free ret - ;----------------------------------------------------------------- ; ; UDP_output @@ -260,7 +255,7 @@ UDP_output: mov dx, [eax + UDP_SOCKET.LocalPort] DEBUGF DEBUG_NETWORK_VERBOSE, "local port=%x\n", dx - sub esp, 8 ; Data ptr and data size will be placed here + sub esp, 4 ; Data ptr will be placed here push edx esi mov edx, [eax + IP_SOCKET.LocalIP] mov eax, [eax + IP_SOCKET.RemoteIP] @@ -269,7 +264,6 @@ UDP_output: call IPv4_output jz .fail mov [esp + 8], eax ; pointer to buffer start - mov [esp + 8 + 4], edx ; buffer size mov [edi + UDP_header.Length], cx rol [edi + UDP_header.Length], 8 diff --git a/kernel/branches/Kolibri-acpi/proc32.inc b/kernel/branches/Kolibri-acpi/proc32.inc index 225fe2251e..acc2b50313 100644 --- a/kernel/branches/Kolibri-acpi/proc32.inc +++ b/kernel/branches/Kolibri-acpi/proc32.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/sec_loader/trunk/startos.ini b/kernel/branches/Kolibri-acpi/sec_loader/trunk/startos.ini index 9de8796b09..66e6a6bdde 100644 --- a/kernel/branches/Kolibri-acpi/sec_loader/trunk/startos.ini +++ b/kernel/branches/Kolibri-acpi/sec_loader/trunk/startos.ini @@ -68,8 +68,8 @@ RamdiskSize=1440K LoaderRamImage=kolibri.img RamdiskPATH=/kolibri/ RamdiskFile=@menu,@menu -RamdiskFile=@PANEL,@PANEL -RamdiskFile=@RB,@PANEL +RamdiskFile=@TASKBAR,@TASKBAR +RamdiskFile=@RB,@TASKBAR [legacy_kolibri] name="KolibriOS" @@ -81,7 +81,7 @@ RamdiskCluster=1 RamdiskSize=1440K RamdiskPATH=/kolibri/ RamdiskFile=@menu,@menu -RamdiskFile=@PANEL,@PANEL +RamdiskFile=@TASKBAR,@TASKBAR RamdiskFile=@RB,@RB RamdiskFile=@rcher,@rcher RamdiskFile=@ss,@ss diff --git a/kernel/branches/Kolibri-acpi/sound/playnote.inc b/kernel/branches/Kolibri-acpi/sound/playnote.inc index 23fdba8c1b..0c3cdac5b3 100644 --- a/kernel/branches/Kolibri-acpi/sound/playnote.inc +++ b/kernel/branches/Kolibri-acpi/sound/playnote.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; PLAYNOTE.INC version 1.1 22 November 2003 ;; diff --git a/kernel/branches/Kolibri-acpi/unpacker.inc b/kernel/branches/Kolibri-acpi/unpacker.inc index 03d221f579..04f44f8fd9 100644 --- a/kernel/branches/Kolibri-acpi/unpacker.inc +++ b/kernel/branches/Kolibri-acpi/unpacker.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/video/blitter.inc b/kernel/branches/Kolibri-acpi/video/blitter.inc index 0d15b4833b..a3e6112063 100644 --- a/kernel/branches/Kolibri-acpi/video/blitter.inc +++ b/kernel/branches/Kolibri-acpi/video/blitter.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2011-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/kernel/branches/Kolibri-acpi/video/cursors.inc b/kernel/branches/Kolibri-acpi/video/cursors.inc index 9a91144f14..b7a663d28b 100644 --- a/kernel/branches/Kolibri-acpi/video/cursors.inc +++ b/kernel/branches/Kolibri-acpi/video/cursors.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -528,7 +528,7 @@ proc restore_24 stdcall, x:dword, y:dword align 4 @@: mov edi, ebx - add ebx, [_display.pitch] + add ebx, [_display.lfb_pitch] mov ecx, [esp] rep movsb @@ -563,7 +563,7 @@ proc restore_32 stdcall, x:dword, y:dword align 4 @@: mov edi, ebx - add ebx, [_display.pitch] + add ebx, [_display.lfb_pitch] mov ecx, [cur.w] rep movsd @@ -597,7 +597,7 @@ proc restore_16 stdcall, x:dword, y:dword align 4 @@: mov edi, ebx - add ebx, [_display.pitch] + add ebx, [_display.lfb_pitch] mov ecx, [cur.w] rep movsw @@ -659,24 +659,18 @@ proc move_cursor_24 stdcall, hcursor:dword, x:dword, y:dword cmp ebx, [_display.width] jb @F mov ebx, [_display.width] - dec ebx ;-------------------------------------- align 4 @@: cmp edi, [_display.height] jb @F mov edi, [_display.height] - dec edi ;-------------------------------------- align 4 @@: - mov [cur.right], ebx - mov [cur.bottom], edi sub ebx, [x] sub edi, [y] - inc ebx - inc edi sub ebx, [_dx] sub edi, [_dy] @@ -690,7 +684,7 @@ align 4 align 4 @@: mov esi, edx - add edx, [_display.pitch] + add edx, [_display.lfb_pitch] mov ecx, [cur.w] lea ecx, [ecx+ecx*2] rep movsb @@ -713,7 +707,7 @@ align 4 mov esi, edx mov edi, ebx add edx, 32*4 - add ebx, [_display.pitch] + add ebx, [_display.lfb_pitch] ;-------------------------------------- align 4 .pix: @@ -779,24 +773,17 @@ proc move_cursor_32 stdcall, hcursor:dword, x:dword, y:dword cmp ebx, [_display.width] jb @F mov ebx, [_display.width] - dec ebx ;-------------------------------------- align 4 @@: cmp edi, [_display.height] jb @F mov edi, [_display.height] - dec edi ;-------------------------------------- align 4 @@: - mov [cur.right], ebx - mov [cur.bottom], edi - sub ebx, [x] sub edi, [y] - inc ebx - inc edi sub ebx, [_dx] sub edi, [_dy] @@ -810,7 +797,7 @@ align 4 align 4 @@: mov esi, edx - add edx, [_display.pitch] + add edx, [_display.lfb_pitch] mov ecx, [cur.w] rep movsd dec eax @@ -832,7 +819,7 @@ align 4 mov esi, edx mov edi, ebx add edx, 32*4 - add ebx, [_display.pitch] + add ebx, [_display.lfb_pitch] ;-------------------------------------- align 4 .pix: @@ -893,25 +880,20 @@ proc move_cursor_16 stdcall, hcursor:dword, x:dword, y:dword lea edx, [LFB_BASE+eax+ecx*2] mov [cur_saved_base], edx - cmp ebx, [Screen_Max_X] - jbe @F - mov ebx, [Screen_Max_X] + cmp ebx, [_display.width] + jb @F + mov ebx, [_display.width] ;-------------------------------------- align 4 @@: - cmp edi, [Screen_Max_Y] - jbe @F - mov edi, [Screen_Max_Y] + cmp edi, [_display.height] + jb @F + mov edi, [_display.height] ;-------------------------------------- align 4 @@: - mov [cur.right], ebx - mov [cur.bottom], edi - sub ebx, [x] sub edi, [y] - inc ebx - inc edi sub ebx, [_dx] sub edi, [_dy] @@ -925,7 +907,7 @@ align 4 align 4 @@: mov esi, edx - add edx, [_display.pitch] + add edx, [_display.lfb_pitch] mov ecx, [cur.w] rep movsw @@ -948,7 +930,7 @@ align 4 mov esi, edx mov edi, ebx add edx, 32*4 - add ebx, [_display.pitch] + add ebx, [_display.lfb_pitch] ;-------------------------------------- align 4 .pix: diff --git a/kernel/branches/Kolibri-acpi/video/vesa12.inc b/kernel/branches/Kolibri-acpi/video/vesa12.inc index d6034d791b..45039cea7f 100644 --- a/kernel/branches/Kolibri-acpi/video/vesa12.inc +++ b/kernel/branches/Kolibri-acpi/video/vesa12.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2011. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; VESA12.INC ;; diff --git a/kernel/branches/Kolibri-acpi/video/vesa20.inc b/kernel/branches/Kolibri-acpi/video/vesa20.inc index 16d43bcc79..590c217c52 100644 --- a/kernel/branches/Kolibri-acpi/video/vesa20.inc +++ b/kernel/branches/Kolibri-acpi/video/vesa20.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; VESA20.INC ;; @@ -236,12 +236,11 @@ end virtual add eax, [putimg.arg_0] mov [putimg.line_increment], eax ; winmap new line increment - mov eax, [Screen_Max_X] - inc eax + mov eax, [_display.width] sub eax, [putimg.real_sx] mov [putimg.winmap_newline], eax ; screen new line increment - mov eax, [_display.pitch] + mov eax, [_display.lfb_pitch] mov ebx, [_display.bytes_per_pixel] imul ecx, ebx sub eax, ecx @@ -262,7 +261,7 @@ end virtual mov eax, [d_width_calc_area + eax*4] add eax, [putimg.abs_cx] - add eax, [_WinMapAddress] + add eax, [_display.win_map] xchg eax, ebp mov ecx, [putimg.real_sx] @@ -876,16 +875,16 @@ align 4 __sys_putpixel: pushad - cmp [Screen_Max_X], eax - jb .exit - cmp [Screen_Max_Y], ebx - jb .exit + cmp eax, [_display.width] + jge .exit + cmp ebx, [_display.height] + jge .exit test edi, 1 ; force ? jnz .forced ; not forced mov edx, [d_width_calc_area + ebx*4] - add edx, [_WinMapAddress] + add edx, [_display.win_map] movzx edx, byte [eax+edx] cmp edx, [CURRENT_TASK] jne .exit @@ -1441,16 +1440,15 @@ end virtual .end_y: mov [drbar.real_sy], ebx ; line_inc_map - mov eax, [Screen_Max_X] + mov eax, [_display.width] sub eax, [drbar.real_sx] - inc eax mov [drbar.line_inc_map], eax ; line_inc_scr mov eax, [drbar.real_sx] mov ebx, [_display.bytes_per_pixel] imul eax, ebx neg eax - add eax, [_display.pitch] + add eax, [_display.lfb_pitch] mov [drbar.line_inc_scr], eax ; pointer to screen mov edx, [drbar.abs_cy] @@ -1466,7 +1464,7 @@ end virtual mov eax, [d_width_calc_area + eax*4] add eax, [drbar.abs_cx] - add eax, [_WinMapAddress] + add eax, [_display.win_map] xchg eax, ebp mov ebx, [drbar.real_sx] @@ -2036,7 +2034,7 @@ vesa20_drawbackground_tiled: ; ebp:=Y*BytesPerScanLine+X*BytesPerPixel+AddrLFB call calculate_edi xchg edi, ebp - add ebp, [_WinMapAddress] + add ebp, [_display.win_map] ; Now eax=x, ebx=y, edi->output, ebp=offset in WinMapAddress ; 2) Calculate offset in background memory block push eax @@ -2149,20 +2147,20 @@ vesa20_drawbackground_stretch: mov eax, [BgrDataWidth] dec eax xor edx, edx - div dword [Screen_Max_X] + div dword [screen_workarea.right] push eax ; high xor eax, eax - div dword [Screen_Max_X] + div dword [screen_workarea.right] push eax ; low ; the same for height mov eax, [BgrDataHeight] dec eax xor edx, edx - div dword [Screen_Max_Y] + div dword [screen_workarea.bottom] push eax ; high xor eax, eax - div dword [Screen_Max_Y] + div dword [screen_workarea.bottom] push eax ; low ; External loop for all y from start to end @@ -2258,7 +2256,7 @@ vesa20_drawbackground_stretch: ; qword [esp+36] = 2^32*(BgrDataWidth-1)/(ScreenWidth-1) sdp3a: - mov eax, [_WinMapAddress] + mov eax, [_display.win_map] cmp [ebp+eax], byte 1 jnz snbgp mov eax, [bgr_cur_line+esi] @@ -2323,8 +2321,7 @@ vesa20_drawbackground_stretch: ; advance edi, ebp to next scan line sub eax, [draw_data+32+RECT.left] sub ebp, eax - add ebp, [Screen_Max_X] - add ebp, 1 + add ebp, [_display.width] sub edi, eax sub edi, eax cmp byte [_display.bytes_per_pixel], 2 @@ -2335,7 +2332,7 @@ vesa20_drawbackground_stretch: sub edi, eax @@: - add edi, [_display.pitch] + add edi, [_display.lfb_pitch] ; restore ecx,edx; advance esi to next background line mov eax, [esp+28] mov ebx, [esp+32] @@ -2356,8 +2353,7 @@ vesa20_drawbackground_stretch: push edi mov esi, bgr_next_line mov edi, bgr_cur_line - mov ecx, [Screen_Max_X] - inc ecx + mov ecx, [_display.width] rep movsd jmp bgr_resmooth1 diff --git a/kernel/branches/Kolibri-acpi/video/vga.inc b/kernel/branches/Kolibri-acpi/video/vga.inc index 46002f7d41..9f11748596 100644 --- a/kernel/branches/Kolibri-acpi/video/vga.inc +++ b/kernel/branches/Kolibri-acpi/video/vga.inc @@ -1,6 +1,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; -;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;; +;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; ;; Distributed under terms of the GNU General Public License ;; ;; ;; ;; VGA.INC ;;