⛏️ index : haiku.git

author Ingo Weinhold <ingo_weinhold@gmx.de> 2010-04-24 12:34:57.0 +00:00:00
committer Ingo Weinhold <ingo_weinhold@gmx.de> 2010-04-24 12:34:57.0 +00:00:00
commit
cb8d31493ded3dcf3f9ad3dd7ef32b2c5b4a294d [patch]
tree
bef53cab8fbc3cab96dced7d260481ec5f0f4a7a
parent
2db29d0806d062799588ded8b1de032ba4287448
download
cb8d31493ded3dcf3f9ad3dd7ef32b2c5b4a294d.tar.gz

Merged r36351-r36352, r36358, r36369, r36402, r36409-r36412, r36414-r36416, r36419, r36426-r36435, r36437, r36439-r36442 from trunk into branch.

git-svn-id: file:///srv/svn/repos/haiku/haiku/branches/releases/r1alpha2@36447 a95241bf-73f2-0310-859d-f6bbb57e9c96

Diff

 build/jam/HaikuImage                                      |   2 +-
 build/jam/OptionalBuildFeatures                           |   2 +-
 build/jam/OptionalPackageDependencies                     |   1 +
 build/jam/OptionalPackages                                | 144 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 build/jam/ReleaseBuildProfiles                            |   4 ++--
 data/artwork/HAIKU alpha 2 logo - white on blue - big     |   0 
 data/artwork/HAIKU logo - black on white - installer      |   0 
 headers/os/interface/Menu.h                               |   2 +-
 headers/private/drivers/scsi_cmds.h                       | 345 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 src/apps/aboutsystem/AboutSystem.cpp                      |  11 ++++++-----
 src/apps/deskcalc/CalcView.cpp                            |   2 +-
 src/apps/deskcalc/ExpressionTextView.cpp                  | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/apps/deskcalc/ExpressionTextView.h                    |   5 +++++
 src/apps/installer/haikulogo.png                          |   0 
 src/bin/less/defines.h                                    |   2 +-
 src/kits/interface/Menu.cpp                               |  19 ++++++++++---------
 headers/private/system/arch/arm/arch_cpu_defs.h           |  12 ++++++++++++
 headers/private/system/arch/m68k/arch_cpu_defs.h          |  12 ++++++++++++
 headers/private/system/arch/mipsel/arch_cpu_defs.h        |  12 ++++++++++++
 headers/private/system/arch/ppc/arch_cpu_defs.h           |  12 ++++++++++++
 headers/private/system/arch/x86/arch_cpu_defs.h           |  12 ++++++++++++
 src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp        |   2 +-
 src/add-ons/kernel/bus_managers/ata/ATADevice.cpp         |  38 +++++++++++++++++++++++++++++---------
 src/add-ons/kernel/bus_managers/ata/ATAInfoblock.h        |  30 ++++++++++++++++++++++++++++--
 src/add-ons/kernel/bus_managers/ata/ATAPrivate.h          | 439 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 src/add-ons/kernel/bus_managers/scsi/bus_raw.c            |  11 +++++++----
 src/add-ons/kernel/file_systems/ext2/Volume.cpp           |   1 +
 src/add-ons/kernel/file_systems/ext2/Volume.h             |   3 +++
 src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp |   2 +-
 src/system/libroot/posix/pthread/pthread_spinlock.c       |  12 +++++++++---
 src/add-ons/kernel/busses/scsi/ahci/Jamfile               |   4 +++-
 src/add-ons/kernel/busses/scsi/ahci/ahci_port.cpp         | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 src/add-ons/kernel/busses/scsi/ahci/ata_cmds.h            |  20 --------------------
 src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp      |  50 +++++++++++++++++++++++++-------------------------
 34 files changed, 924 insertions(+), 572 deletions(-)

diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage
index fb41548..ebd5140 100644
--- a/build/jam/HaikuImage
+++ b/build/jam/HaikuImage
@@ -74,7 +74,7 @@
	Touchpad <preference>Tracker VirtualMemory
;
SYSTEM_DEMOS = BSnow Chart Clock Cortex FontDemo
	GLTeapot Haiku3d Mandelbrot Pairs Playground Pulse Sudoku Gradients
	GLTeapot Haiku3d Mandelbrot Pairs Playground Pulse Sudoku
;
ICU_LIBS = libicu-common.so libicu-data.so libicu-i18n.so
;
diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures
index 63694af..4858c82 100644
--- a/build/jam/OptionalBuildFeatures
+++ b/build/jam/OptionalBuildFeatures
@@ -12,7 +12,7 @@
}

local baseURL = http://haiku-files.org/files/optional-packages ;
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0-x86-gcc2-2010-04-08.zip ;
HAIKU_OPENSSL_PACKAGE = openssl-1.0.0-r1a2-x86-gcc2-2010-04-22.zip ;
HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE) ;

if $(HAIKU_BUILD_FEATURE_SSL) {
diff --git a/build/jam/OptionalPackageDependencies b/build/jam/OptionalPackageDependencies
index 458dc3d..813e5b4 100644
--- a/build/jam/OptionalPackageDependencies
+++ b/build/jam/OptionalPackageDependencies
@@ -23,4 +23,5 @@
OptionalPackageDependencies Vim : LibIconv ;
OptionalPackageDependencies XZ-Utils : Tar ;
OptionalPackageDependencies Tar : LibIconv ; 
OptionalPackageDependencies WebPositive : Curl LibXML2 SQLite ; 

diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages
index aab175f..8b4ea3d 100644
--- a/build/jam/OptionalPackages
+++ b/build/jam/OptionalPackages
@@ -67,6 +67,7 @@
#	Vim						- the command line text editor
#	Vision					- powerful native IRC client
#	VLC						- the multi media player with native interface
#	WebPositive				- native, WebKit-based web browser
#	Welcome					- introductory documentation to Haiku
#	WifiFirmwareScriptData	- data files needed by install-wifi-firmwares.sh
#	WonderBrush				- native graphics application
@@ -93,8 +94,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package APR available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage apr-1.3.9-x86-gcc2-2009-10-18.zip
			: $(baseURL)/apr-1.3.9-x86-gcc2-2009-10-18.zip
		InstallOptionalHaikuImagePackage apr-1.4.2-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/apr-1.4.2-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -107,8 +108,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package APR-util available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage apr-util-1.3.9-r1a1-x86-gcc2-2009-08-29.zip
			: $(baseURL)/apr-util-1.3.9-r1a1-x86-gcc2-2009-08-29.zip
		InstallOptionalHaikuImagePackage apr-util-1.3.9-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/apr-util-1.3.9-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -279,8 +280,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Bzip available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage bzip2-1.0.5-x86-gcc2-2009-12-27.zip
			: $(baseURL)/bzip2-1.0.5-x86-gcc2-2009-12-27.zip
		InstallOptionalHaikuImagePackage bzip2-1.0.5-r1a2-x86-gcc2-2010-04-21.zip
			: $(baseURL)/bzip2-1.0.5-r1a2-x86-gcc2-2010-04-21.zip
			:
			: true
		;
@@ -345,8 +346,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package CMake available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage cmake-2.8.0-x86-gcc2-2009-11-15.zip
			: $(baseURL)/cmake-2.8.0-x86-gcc2-2009-11-15.zip
		InstallOptionalHaikuImagePackage cmake-2.8.0-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/cmake-2.8.0-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -359,10 +360,9 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Curl available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage curl-7.20.1-x86-gcc2-2010-04-16.zip
			: $(baseURL)/curl-7.20.1-x86-gcc2-2010-04-16.zip
		InstallOptionalHaikuImagePackage curl-7.20.1-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/curl-7.20.1-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
	}
}
@@ -385,20 +385,20 @@
# Development
if [ IsOptionalHaikuImagePackageAdded Development ] && $(TARGET_ARCH) = x86 {
	# autotools
	InstallOptionalHaikuImagePackage autoconf-2.65-x86-gcc2-2009-11-28.zip
		: $(baseURL)/autoconf-2.65-x86-gcc2-2009-11-28.zip
	InstallOptionalHaikuImagePackage autoconf-2.65-x86-gcc2-2010-04-21.zip
		: $(baseURL)/autoconf-2.65-r1a2-x86-gcc2-2010-04-21.zip
		:
		: true ;
	InstallOptionalHaikuImagePackage automake-1.11.1-x86-gcc2-2009-12-23.zip
		: $(baseURL)/automake-1.11.1-x86-gcc2-2009-12-23.zip
	InstallOptionalHaikuImagePackage automake-1.11.1-x86-gcc2-2010-04-21.zip
		: $(baseURL)/automake-1.11.1-r1a2-x86-gcc2-2010-04-21.zip
		:
		: true ;
	InstallOptionalHaikuImagePackage libtool-2.2.6b-x86-gcc2-2010-04-08.zip
		: $(baseURL)/libtool-2.2.6b-x86-gcc2-2010-04-08.zip
	InstallOptionalHaikuImagePackage libtool-2.2.6b-r1a2-x86-gcc2-2010-04-21.zip
		: $(baseURL)/libtool-2.2.6b-r1a2-x86-gcc2-2010-04-21.zip
		:
		: true ;
	InstallOptionalHaikuImagePackage texinfo-4.13a-r1a1-x86-gcc2-2009-08-30.zip
		: $(baseURL)/texinfo-4.13a-r1a1-x86-gcc2-2009-08-30.zip
	InstallOptionalHaikuImagePackage texinfo-4.13a-r1a2-x86-gcc2-2009-04-21.zip
		: $(baseURL)/texinfo-4.13a-r1a2-x86-gcc2-2010-04-21.zip
		:
		: true ;
}
@@ -409,8 +409,8 @@
		&& $(TARGET_ARCH) = x86 {
	# gcc and binutils
	if $(HAIKU_GCC_VERSION[1]) = 2 || $(isHybridBuild) {
		InstallOptionalHaikuImagePackage gcc-2.95.3-r1a2-x86-gcc2-2010-04-20.zip
			: $(baseURL)/gcc-2.95.3-r1a2-x86-gcc2-2010-04-20.zip ;
		InstallOptionalHaikuImagePackage gcc-2.95.3-r1a2-x86-gcc2-2010-04-20-1.zip
			: $(baseURL)/gcc-2.95.3-r1a2-x86-gcc2-2010-04-20-1.zip ;
	}

	if $(HAIKU_GCC_VERSION[1]) = 2 {
@@ -421,8 +421,8 @@
	}

	if $(HAIKU_GCC_VERSION[1]) = 4 || $(isHybridBuild) {
		InstallOptionalHaikuImagePackage gcc-4.3.3-r1a1-x86-gcc4-2009-06-29.zip
			: $(baseURL)/gcc-4.3.3-r1a1-x86-gcc4-2009-06-29.zip ;
		InstallOptionalHaikuImagePackage gcc-4.3.3-r1a2-x86-gcc4-2010-04-22.zip
			: $(baseURL)/gcc-4.3.3-r1a2-x86-gcc4-2010-04-22.zip ;
	}

	if $(HAIKU_GCC_VERSION[1]) = 4 {
@@ -434,20 +434,20 @@
		local libs = libstdc++.so libsupc++.so ;
		for lib in $(libs) {
			AddSymlinkToHaikuHybridImage
				develop abi x86 gcc4 tools gcc-4.3.3-haiku-090629 lib
				develop abi x86 gcc4 tools gcc-4.3.3-haiku-100422 lib
				: /system/lib $(lib) : : true ;
		}
	}

	# other commonly used tools
	InstallOptionalHaikuImagePackage bison-2.4.1-r1a1-x86-gcc2-2009-08-31.zip
		: $(baseURL)/bison-2.4.1-r1a1-x86-gcc2-2009-08-31.zip ;
	InstallOptionalHaikuImagePackage m4-1.4.14-x86-gcc2-2010-02-27.zip
		: $(baseURL)/m4-1.4.14-x86-gcc2-2010-02-27.zip ;
	InstallOptionalHaikuImagePackage flex-2.5.35-r1a1-x86-gcc2-2009-08-31.zip
		: $(baseURL)/flex-2.5.35-r1a1-x86-gcc2-2009-08-31.zip ;
	InstallOptionalHaikuImagePackage jam-2.5-r1a1-x86-gcc2-2009-08-31.zip
		: $(baseURL)/jam-2.5-r1a1-x86-gcc2-2009-08-31.zip ;
	InstallOptionalHaikuImagePackage bison-2.4.1-r1a2-x86-gcc2-2010-04-21.zip
		: $(baseURL)/bison-2.4.1-r1a2-x86-gcc2-2010-04-21.zip ;
	InstallOptionalHaikuImagePackage m4-1.4.14-r1a2-x86-gcc2-2010-04-21.zip
		: $(baseURL)/m4-1.4.14-r1a2-x86-gcc2-2010-04-21.zip ;
	InstallOptionalHaikuImagePackage flex-2.5.35-r1a2-x86-gcc2-2010-04-21.zip
		: $(baseURL)/flex-2.5.35-r1a2-x86-gcc2-2010-04-21.zip ;
	InstallOptionalHaikuImagePackage jam-2.5-r1a2-x86-gcc2-2010-04-21.zip
		: $(baseURL)/jam-2.5-r1a2-x86-gcc2-2010-04-21.zip ;

}

@@ -569,8 +569,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Expat available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage expat-2.0.1-x86-gcc2-2010-03-08.zip
			: $(baseURL)/expat-2.0.1-x86-gcc2-2010-03-08.zip
		InstallOptionalHaikuImagePackage expat-2.0.1-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/expat-2.0.1-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -599,8 +599,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Git available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage git-1.7.0.5-x86-gcc2-2010-04-14.zip
			: $(baseURL)/git-1.7.0.5-x86-gcc2-2010-04-14.zip
		InstallOptionalHaikuImagePackage git-1.7.0.5-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/git-1.7.0.5-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -659,8 +659,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package LibIconv available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage libiconv-1.13.1-r1a1-x86-gcc2-2009-09-08.zip
			: $(baseURL)/libiconv-1.13.1-r1a1-x86-gcc2-2009-09-08.zip
		InstallOptionalHaikuImagePackage libiconv-1.13.1-r1a2-x86-gcc2-2010-04-21.zip
			: $(baseURL)/libiconv-1.13.1-r1a2-x86-gcc2-2010-04-21.zip
			:
		;
	}
@@ -687,10 +687,9 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage libxml2-2.7.7-x86-gcc2-2010-04-11.zip
			: $(baseURL)/libxml2-2.7.7-x86-gcc2-2010-04-11.zip
		InstallOptionalHaikuImagePackage libxml2-2.7.7-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/libxml2-2.7.7-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
	}
}
@@ -701,8 +700,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package LibXSLT available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage libxslt-1.1.26-x86-gcc2-2010-04-11.zip
			: $(baseURL)/libxslt-1.1.26-x86-gcc2-2010-04-11.zip
		InstallOptionalHaikuImagePackage libxslt-1.1.26-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/libxslt-1.1.26-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -752,8 +751,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Nano available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage nano-2.2.3-x86-gcc2-2010-03-11.zip
			: $(baseURL)/nano-2.2.3-x86-gcc2-2010-03-11.zip
		InstallOptionalHaikuImagePackage nano-2.2.3-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/nano-2.2.3-r1a2-x86-gcc2-2010-04-22.zip
			:
		;
	}
@@ -765,8 +764,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Neon available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage neon-0.29.3-x86-gcc2-2010-04-08.zip
			: $(baseURL)/neon-0.29.3-x86-gcc2-2010-04-08.zip
		InstallOptionalHaikuImagePackage neon-0.29.3-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/neon-0.29.3-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -868,8 +867,8 @@
				"variable to be set!" ;
		}

		InstallOptionalHaikuImagePackage openssh-5.5p1-x86-gcc2-2010-04-16.zip
			: $(baseURL)/openssh-5.5p1-x86-gcc2-2010-04-16.zip
		InstallOptionalHaikuImagePackage openssh-5.5p1-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/openssh-5.5p1-r1a2-x86-gcc2-2010-04-22.zip
			:
		;

@@ -903,8 +902,8 @@
				:
			;
		} else {
			InstallOptionalHaikuImagePackage p7zip-9.04-x86-gcc2-2009-10-25.zip
				: $(baseURL)/p7zip-9.04-x86-gcc2-2009-10-25.zip
			InstallOptionalHaikuImagePackage p7zip-9.04-r1a2-x86-gcc2-2010-04-22c.zip
				: $(baseURL)/p7zip-9.04-r1a2-x86-gcc2-2010-04-22c.zip
				:
			;
		}
@@ -977,8 +976,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Python available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage python-2.6.5-x86-gcc2-2010-04-08.zip
			: $(baseURL)/python-2.6.5-x86-gcc2-2010-04-08.zip
		InstallOptionalHaikuImagePackage python-2.6.5-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/python-2.6.5-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
@@ -991,8 +990,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Rsync available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage rsync-3.0.7-x86-gcc2-2010-01-05.zip
			: $(baseURL)/rsync-3.0.7-x86-gcc2-2010-01-05.zip
		InstallOptionalHaikuImagePackage rsync-3.0.7-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/rsync-3.0.7-r1a2-x86-gcc2-2010-04-22.zip
			:
		;
	}
@@ -1004,8 +1003,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Sed available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage sed-4.2.1-r1a1-x86-gcc2-2009-08-30.zip
			: $(baseURL)/sed-4.2.1-r1a1-x86-gcc2-2009-08-30.zip
		InstallOptionalHaikuImagePackage sed-4.2.1-r1a2-x86-gcc2-2010-04-21.zip
			: $(baseURL)/sed-4.2.1-r1a2-x86-gcc2-2010-04-21.zip
			:
			:
		;
@@ -1018,10 +1017,9 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package SQLite available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage sqlite-3.6.22-x86-gcc2-2010-03-09.zip
			: $(baseURL)/sqlite-3.6.22-x86-gcc2-2010-03-09.zip
		InstallOptionalHaikuImagePackage sqlite-3.6.23-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/sqlite-3.6.23-r1a2-x86-gcc2-2010-04-22.zip
			:
			: true
		;
	}
}
@@ -1046,8 +1044,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Tar available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage tar-1.22-x86-gcc4-2010-02-25.zip
			: $(baseURL)/tar-1.22-x86-gcc4-2010-02-25.zip
		InstallOptionalHaikuImagePackage tar-1.22-r1a2-x86-gcc2-2010-04-22.zip
			: $(baseURL)/tar-1.22-r1a2-x86-gcc2-2010-04-22.zip
			:
		;
	}
@@ -1176,6 +1174,24 @@
			: "/boot/apps/vlc-0.8.6d/VLC media player" ;
		AddSymlinkToHaikuImage common bin
			: "/boot/apps/vlc-0.8.6d/VLC media player" : vlc ;
	}
}


# WebPositive
if [ IsOptionalHaikuImagePackageAdded WebPositive ] {
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package WebPositive available for $(TARGET_ARCH)" ;
	} else if $(HAIKU_GCC_VERSION[1]) < 4 && ! $(isHybridBuild) {
		Echo "No optional package WebPositive available for gcc2" ;
	} else {
		InstallOptionalHaikuImagePackage
			WebPositive-r1a2-gcc4-x86-r459-2010-04-23.zip
			: $(baseURL)/WebPositive-r1a2-gcc4-x86-r459-2010-04-23.zip
			:
		;
		AddSymlinkToHaikuImage home config be Applications
			: /boot/apps/WebPositive/WebPositive ;
	}
}

@@ -1292,8 +1308,8 @@
	if $(TARGET_ARCH) != x86 {
		Echo "No optional package Yasm available for $(TARGET_ARCH)" ;
	} else {
		InstallOptionalHaikuImagePackage yasm-0.8.0-r1a1-x86-gcc2-2009-08-30.zip
			: $(baseURL)/yasm-0.8.0-r1a1-x86-gcc2-2009-08-30.zip
		InstallOptionalHaikuImagePackage yasm-0.8.0-r1a2-x86-gcc2-2010-04-21.zip
			: $(baseURL)/yasm-0.8.0-r1a2-x86-gcc2-2010-04-21.zip
			:
		;
	}
diff --git a/build/jam/ReleaseBuildProfiles b/build/jam/ReleaseBuildProfiles
index 33c5202..84025e3 100644
--- a/build/jam/ReleaseBuildProfiles
+++ b/build/jam/ReleaseBuildProfiles
@@ -18,8 +18,8 @@
		HAIKU_IMAGE_HOST_NAME = shredder ;
		HAIKU_IMAGE_SIZE = 650 ;

		AddOptionalHaikuImagePackages BePDF BeZillaBrowser Clockwerk Pe Vision
			VLC WonderBrush ;
		AddOptionalHaikuImagePackages BePDF Clockwerk Pe Vision
			WebPositive WonderBrush ;
		AddOptionalHaikuImagePackages CVS Development Git Mercurial
			Python Subversion OpenSSH OpenSSL ;
		AddOptionalHaikuImagePackages Nano P7zip Welcome BeBook XZ-Utils ;
diff --git a/data/artwork/HAIKU alpha 2 logo - white on blue - big b/data/artwork/HAIKU alpha 2 logo - white on blue - big
new file mode 100644
index 0000000000000000000000000000000000000000..83d9df1afb002e14b79372dcb93df3501d89368e 100644
Binary files /dev/null and b/data/artwork/HAIKU alpha 2 logo - white on blue - big differdiff --git a/data/artwork/HAIKU logo - black on white - installer b/data/artwork/HAIKU logo - black on white - installer
new file mode 100644
index 0000000000000000000000000000000000000000..d123f7e63813bd79675213cb363bb5a3098d107f 100644
Binary files /dev/null and b/data/artwork/HAIKU logo - black on white - installer differdiff --git a/headers/os/interface/Menu.h b/headers/os/interface/Menu.h
index b218a26..7551edc 100644
--- a/headers/os/interface/Menu.h
+++ b/headers/os/interface/Menu.h
@@ -245,7 +245,7 @@
			bool				_ChooseTrigger(const char* title, int32& index,
									uint32& trigger,
									BPrivate::TriggerList& triggers);
			void				_UpdateWindowViewSize();
			void				_UpdateWindowViewSize(const bool &updatePosition);
			bool				_OkToProceed(BMenuItem* item);

			bool				_CustomTrackingWantsToQuit();
diff --git a/headers/private/drivers/scsi_cmds.h b/headers/private/drivers/scsi_cmds.h
index 3231029..b7aefc7 100644
--- a/headers/private/drivers/scsi_cmds.h
+++ b/headers/private/drivers/scsi_cmds.h
@@ -1,5 +1,5 @@
/*
 * Copyright 2004-2007, Haiku, Inc. All RightsReserved.
 * Copyright 2004-2010, Haiku, Inc. All RightsReserved.
 * Copyright 2002/03, Thomas Kurschel. All rights reserved.
 *
 * Distributed under the terms of the MIT License.
@@ -7,158 +7,204 @@
#ifndef _SCSI_CMDS_H
#define _SCSI_CMDS_H

// SCSI commands and their data structures and constants

//! SCSI commands and their data structures and constants


#include <lendian_bitfield.h>


// always keep in mind that SCSI is big-endian !!!
// Always keep in mind that SCSI is big-endian!

#define SCSI_STD_TIMEOUT 10

// SCSI device status (as the result of a command)
#define SCSI_STATUS_GOOD (0 << 1)
#define SCSI_STATUS_CHECK_CONDITION (1 << 1)	// error occured
#define SCSI_STATUS_CONDITION_MET (2 << 1)		// "found" for SEARCH DATA and PREFETCH
#define SCSI_STATUS_BUSY (4 << 1)				// try again later (??? == QUEUE_FULL ???)
#define SCSI_STATUS_INTERMEDIATE (8 << 1)		// used by linked command only
#define SCSI_STATUS_INTERMEDIATE_COND_MET (10 << 1) // ditto
#define SCSI_STATUS_RESERVATION_CONFLICT (12 << 1) // only if RESERVE/RELEASE is used
#define SCSI_STATUS_COMMAND_TERMINATED (17 << 1) // aborted by TERMINATE I/O PROCESS
#define SCSI_STATUS_QUEUE_FULL (20 << 1)		// queue full
#define SCSI_STATUS_GOOD					(0 << 1)
#define SCSI_STATUS_CHECK_CONDITION			(1 << 1)	// error occured
#define SCSI_STATUS_CONDITION_MET			(2 << 1)
	// "found" for SEARCH DATA and PREFETCH
#define SCSI_STATUS_BUSY					(4 << 1)
	// try again later (??? == QUEUE_FULL ???)
#define SCSI_STATUS_INTERMEDIATE			(8 << 1)
	// used by linked command only
#define SCSI_STATUS_INTERMEDIATE_COND_MET	(10 << 1)	// ditto
#define SCSI_STATUS_RESERVATION_CONFLICT	(12 << 1)
	// only if RESERVE/RELEASE is used
#define SCSI_STATUS_COMMAND_TERMINATED		(17 << 1)
	// aborted by TERMINATE I/O PROCESS
#define SCSI_STATUS_QUEUE_FULL				(20 << 1)	// queue full

#define SCSI_STATUS_MASK 0xfe

// SCSI sense key
#define SCSIS_KEY_NO_SENSE 0
#define SCSIS_KEY_RECOVERED_ERROR 1
#define SCSIS_KEY_NOT_READY 2				// operator intervention may be required
#define SCSIS_KEY_MEDIUM_ERROR 3			// can be set if source could be hardware error
#define SCSIS_KEY_HARDWARE_ERROR 4
#define SCSIS_KEY_ILLEGAL_REQUEST 5			// invalid command
#define SCSIS_KEY_UNIT_ATTENTION 6			// medium changed or target reset
#define SCSIS_KEY_DATA_PROTECT 7			// data access forbidden
#define SCSIS_KEY_BLANK_CHECK 8				// tried to read blank or to write non-blank medium
#define SCSIS_KEY_VENDOR_SPECIFIC 9
#define SCSIS_KEY_COPY_ABORTED 10			// error in COPY or COMPARE command
#define SCSIS_KEY_ABORTED_COMMAND 11		// aborted by target, retry *may* help
#define SCSIS_KEY_EQUAL 12					// during SEARCH: data found
#define SCSIS_KEY_VOLUME_OVERFLOW 13		// tried to write buffered data beyond end of medium
#define SCSIS_KEY_MISCOMPARE 14
#define SCSIS_KEY_RESERVED 15
#define SCSIS_KEY_NO_SENSE					0
#define SCSIS_KEY_RECOVERED_ERROR			1
#define SCSIS_KEY_NOT_READY					2
	// operator intervention may be required
#define SCSIS_KEY_MEDIUM_ERROR				3
	// can be set if source could be hardware error
#define SCSIS_KEY_HARDWARE_ERROR			4
#define SCSIS_KEY_ILLEGAL_REQUEST			5	// invalid command
#define SCSIS_KEY_UNIT_ATTENTION			6
	// medium changed or target reset
#define SCSIS_KEY_DATA_PROTECT				7	// data access forbidden
#define SCSIS_KEY_BLANK_CHECK				8
	// tried to read blank or to write non-blank medium
#define SCSIS_KEY_VENDOR_SPECIFIC			9
#define SCSIS_KEY_COPY_ABORTED				10
	// error in COPY or COMPARE command
#define SCSIS_KEY_ABORTED_COMMAND			11
	// aborted by target, retry *may* help
#define SCSIS_KEY_EQUAL						12	// during SEARCH: data found
#define SCSIS_KEY_VOLUME_OVERFLOW			13
	// tried to write buffered data beyond end of medium
#define SCSIS_KEY_MISCOMPARE				14
#define SCSIS_KEY_RESERVED					15

// SCSI ASC and ASCQ data - (ASC << 8) | ASCQ
// all codes with bit 7 of ASC or ASCQ set are vendor-specific
#define SCSIS_ASC_NO_SENSE 0x0000
#define SCSIS_ASC_IO_PROC_TERMINATED 0x0006
#define SCSIS_ASC_AUDIO_PLAYING 0x0011
#define SCSIS_ASC_AUDIO_PAUSED 0x0012
#define SCSIS_ASC_AUDIO_COMPLETED 0x0013
#define SCSIS_ASC_AUDIO_ERROR 0x0014		// playing has stopped due to error
#define SCSIS_ASC_AUDIO_NO_STATUS 0x0015
#define SCSIS_ASC_NO_INDEX 0x0100			// no index/sector signal
#define SCSIS_ASC_NO_SEEK_CMP 0x0200		// ???
#define SCSIS_ASC_WRITE_FAULT 0x0300
#define SCSIS_ASC_LUN_NOT_READY 0x0400		// LUN not ready, cause not reportable
#define SCSIS_ASC_LUN_BECOMING_READY 0x0401 // LUN in progress of becoming ready
#define SCSIS_ASC_LUN_NEED_INIT 0x0402		// LUN need initializing command
#define SCSIS_ASC_LUN_NEED_MANUAL_HELP 0x0403 // LUN needs manual intervention
#define SCSIS_ASC_LUN_FORMATTING 0x0404		// LUN format in progress
#define SCSIS_ASC_LUN_SEL_FAILED 0x0500		// LUN doesn't respond to selection
#define SCSIS_ASC_LUN_COM_FAILURE 0x0800	// LUN communication failure
#define SCSIS_ASC_LUN_TIMEOUT 0x0801		// LUN communication time-out
#define SCSIS_ASC_LUN_COM_PARITY 0x0802		// LUN communication parity failure
#define SCSIS_ASC_LUN_COM_CRC 0x0803		// LUN communication CRC failure (SCSI-3)
#define SCSIS_ASC_WRITE_ERR_AUTOREALLOC 0x0c01	// recovered by auto-reallocation
#define SCSIS_ASC_NO_SENSE					0x0000
#define SCSIS_ASC_IO_PROC_TERMINATED		0x0006
#define SCSIS_ASC_AUDIO_PLAYING				0x0011
#define SCSIS_ASC_AUDIO_PAUSED				0x0012
#define SCSIS_ASC_AUDIO_COMPLETED			0x0013
#define SCSIS_ASC_AUDIO_ERROR				0x0014
	// playing has stopped due to error
#define SCSIS_ASC_AUDIO_NO_STATUS			0x0015
#define SCSIS_ASC_NO_INDEX					0x0100	// no index/sector signal
#define SCSIS_ASC_NO_SEEK_CMP				0x0200	// ???
#define SCSIS_ASC_WRITE_FAULT				0x0300
#define SCSIS_ASC_LUN_NOT_READY				0x0400
	// LUN not ready, cause not reportable
#define SCSIS_ASC_LUN_BECOMING_READY		0x0401
	// LUN in progress of becoming ready
#define SCSIS_ASC_LUN_NEED_INIT				0x0402
	// LUN need initializing command
#define SCSIS_ASC_LUN_NEED_MANUAL_HELP		0x0403
	// LUN needs manual intervention
#define SCSIS_ASC_LUN_FORMATTING			0x0404
	// LUN format in progress
#define SCSIS_ASC_LUN_SEL_FAILED			0x0500
	// LUN doesn't respond to selection
#define SCSIS_ASC_LUN_COM_FAILURE			0x0800	// LUN communication failure
#define SCSIS_ASC_LUN_TIMEOUT				0x0801
	// LUN communication time-out
#define SCSIS_ASC_LUN_COM_PARITY			0x0802
	// LUN communication parity failure
#define SCSIS_ASC_LUN_COM_CRC				0x0803
	// LUN communication CRC failure (SCSI-3)
#define SCSIS_ASC_WRITE_ERR_AUTOREALLOC		0x0c01
	// recovered by auto-reallocation
#define SCSIS_ASC_WRITE_ERR_AUTOREALLOC_FAILED 0x0c02
#define SCSIS_ASC_ECC_ERROR 0x1000
#define SCSIS_ASC_UNREC_READ_ERR 0x1100		// unrecovered read error
#define SCSIS_ASC_READ_RETRIES_EXH 0x1101	// read retries exhausted
#define SCSIS_ASC_UNREC_READ_ERR_AUTOREALLOC_FAILED 0x1104 // above + auto-reallocate failed
#define SCSIS_ASC_RECORD_NOT_FOUND 0x1401
#define SCSIS_ASC_RANDOM_POS_ERROR 0x1500	// random positioning error
#define SCSIS_ASC_POSITIONING_ERR 0x1501	// mechanical positioning error
#define SCSIS_ASC_POS_ERR_ON_READ 0x1502	// positioning error detected by reading
#define SCSIS_ASC_DATA_RECOV_NO_ERR_CORR 0x1700	// recovered with no error correction applied
#define SCSIS_ASC_DATA_RECOV_WITH_RETRIES 0x1701 
#define SCSIS_ASC_DATA_RECOV_POS_HEAD_OFS 0x1702 // ?recovered with positive head offset
#define SCSIS_ASC_DATA_RECOV_NEG_HEAD_OFS 0x1703 // ?recovered with negative head offset
#define SCSIS_ASC_DATA_RECOV_WITH_RETRIES_CIRC 0x1704 // recovered with retries/CIRC
#define SCSIS_ASC_DATA_RECOV_PREV_SECT_ID 0x1705 // recovered using previous sector ID
#define SCSIS_ASC_ECC_ERROR					0x1000
#define SCSIS_ASC_UNREC_READ_ERR			0x1100	// unrecovered read error
#define SCSIS_ASC_READ_RETRIES_EXH			0x1101	// read retries exhausted
#define SCSIS_ASC_UNREC_READ_ERR_AUTOREALLOC_FAILED 0x1104
	// above + auto-reallocate failed
#define SCSIS_ASC_RECORD_NOT_FOUND			0x1401
#define SCSIS_ASC_RANDOM_POS_ERROR			0x1500	// random positioning error
#define SCSIS_ASC_POSITIONING_ERR			0x1501
	// mechanical positioning error
#define SCSIS_ASC_POS_ERR_ON_READ			0x1502
	// positioning error detected by reading
#define SCSIS_ASC_DATA_RECOV_NO_ERR_CORR	0x1700
	// recovered with no error correction applied
#define SCSIS_ASC_DATA_RECOV_WITH_RETRIES	0x1701
#define SCSIS_ASC_DATA_RECOV_POS_HEAD_OFS	0x1702
	// ?recovered with positive head offset
#define SCSIS_ASC_DATA_RECOV_NEG_HEAD_OFS	0x1703
	// ?recovered with negative head offset
#define SCSIS_ASC_DATA_RECOV_WITH_RETRIES_CIRC 0x1704
	// recovered with retries/CIRC
#define SCSIS_ASC_DATA_RECOV_PREV_SECT_ID	0x1705
	// recovered using previous sector ID
#define SCSIS_ASC_DATA_RECOV_NO_ECC_AUTOREALLOC 0x1706
#define SCSIS_ASC_DATA_RECOV_NO_ECC_REASSIGN 0x1707 // reassign recommended
#define SCSIS_ASC_DATA_RECOV_NO_ECC_REWRITE 0x1708 // rewrite recommended
#define SCSIS_ASC_DATA_RECOV_WITH_CORR 0x1800 // recovered using error correction
#define SCSIS_ASC_DATA_RECOV_WITH_CORR_RETRIES 0x1801 // used error correction and retries
#define SCSIS_ASC_DATA_RECOV_AUTOREALLOC 0x1802
#define SCSIS_ASC_DATA_RECOV_CIRC 0x1803	// recovered using CIRC
#define SCSIS_ASC_DATA_RECOV_LEC 0x1804		// recovered using LEC
#define SCSIS_ASC_DATA_RECOV_REASSIGN 0x1805 // reassign recommended
#define SCSIS_ASC_DATA_RECOV_REWRITE 0x1806 // rewrite recommended
#define SCSIS_ASC_PARAM_LIST_LENGTH_ERR 0x1a00	// parameter list too short
#define SCSIS_ASC_ID_RECOV 0x1e00			// recoved ID with ECC
#define SCSIS_ASC_INV_OPCODE 0x2000
#define SCSIS_ASC_LBA_OOR 0x2100			// LBA out of range
#define SCSIS_ASC_ILL_FUNCTION 0x2200		// better use 0x2000/0x2400/0x2600 instead
#define SCSIS_ASC_INV_CDB_FIELD 0x2400
#define SCSIS_ASC_LUN_NOT_SUPPORTED 0x2500
#define SCSIS_ASC_INV_PARAM_LIST_FIELD 0x2600
#define SCSIS_ASC_PARAM_NOT_SUPPORTED 0x2601
#define SCSIS_ASC_PARAM_VALUE_INV 0x2602
#define SCSIS_ASC_WRITE_PROTECTED 0x2700
#define SCSIS_ASC_MEDIUM_CHANGED 0x2800
#define SCSIS_ASC_WAS_RESET 0x2900			// reset by power-on/bus reset/device reset
#define SCSIS_ASC_PARAMS_CHANGED 0x2a00
#define SCSIS_ASC_MEDIUM_FORMAT_CORRUPTED 0x3100
#define SCSIS_ASC_ROUNDED_PARAM 0x3700		// parameter got rounded
#define SCSIS_ASC_NO_MEDIUM 0x3a00			// medium not present
#define SCSIS_ASC_INTERNAL_FAILURE 0x4400
#define SCSIS_ASC_SEL_FAILURE 0x4500		// select/reselect failure
#define SCSIS_ASC_UNSUCC_SOFT_RESET 0x4600	// unsuccessful soft reset
#define SCSIS_ASC_SCSI_PARITY_ERR 0x4700	// SCSI parity error
#define SCSIS_ASC_LOAD_EJECT_FAILED 0x5300	// media load or eject failed
#define SCSIS_ASC_REMOVAL_PREVENTED 0x5302	// medium removal prevented
#define SCSIS_ASC_REMOVAL_REQUESTED 0x5a01	// operator requests medium removal
#define SCSIS_ASC_DATA_RECOV_NO_ECC_REWRITE	0x1708	// rewrite recommended
#define SCSIS_ASC_DATA_RECOV_WITH_CORR		0x1800
	// recovered using error correction
#define SCSIS_ASC_DATA_RECOV_WITH_CORR_RETRIES 0x1801
	// used error correction and retries
#define SCSIS_ASC_DATA_RECOV_AUTOREALLOC	0x1802
#define SCSIS_ASC_DATA_RECOV_CIRC			0x1803	// recovered using CIRC
#define SCSIS_ASC_DATA_RECOV_LEC			0x1804	// recovered using LEC
#define SCSIS_ASC_DATA_RECOV_REASSIGN		0x1805	// reassign recommended
#define SCSIS_ASC_DATA_RECOV_REWRITE		0x1806	// rewrite recommended
#define SCSIS_ASC_PARAM_LIST_LENGTH_ERR		0x1a00	// parameter list too short
#define SCSIS_ASC_ID_RECOV					0x1e00	// recoved ID with ECC
#define SCSIS_ASC_INV_OPCODE				0x2000
#define SCSIS_ASC_LBA_OOR					0x2100	// LBA out of range
#define SCSIS_ASC_ILL_FUNCTION				0x2200
	// better use 0x2000/0x2400/0x2600 instead
#define SCSIS_ASC_INV_CDB_FIELD				0x2400
#define SCSIS_ASC_LUN_NOT_SUPPORTED			0x2500
#define SCSIS_ASC_INV_PARAM_LIST_FIELD		0x2600
#define SCSIS_ASC_PARAM_NOT_SUPPORTED		0x2601
#define SCSIS_ASC_PARAM_VALUE_INV			0x2602
#define SCSIS_ASC_WRITE_PROTECTED			0x2700
#define SCSIS_ASC_MEDIUM_CHANGED			0x2800
#define SCSIS_ASC_WAS_RESET					0x2900
	// reset by power-on/bus reset/device reset
#define SCSIS_ASC_PARAMS_CHANGED			0x2a00
#define SCSIS_ASC_MEDIUM_FORMAT_CORRUPTED	0x3100
#define SCSIS_ASC_ROUNDED_PARAM				0x3700	// parameter got rounded
#define SCSIS_ASC_NO_MEDIUM					0x3a00	// medium not present
#define SCSIS_ASC_INTERNAL_FAILURE			0x4400
#define SCSIS_ASC_SEL_FAILURE				0x4500	// select/reselect failure
#define SCSIS_ASC_UNSUCC_SOFT_RESET			0x4600	// unsuccessful soft reset
#define SCSIS_ASC_SCSI_PARITY_ERR			0x4700	// SCSI parity error
#define SCSIS_ASC_LOAD_EJECT_FAILED			0x5300
	// media load or eject failed
#define SCSIS_ASC_REMOVAL_PREVENTED			0x5302	// medium removal prevented
#define SCSIS_ASC_REMOVAL_REQUESTED			0x5a01
	// operator requests medium removal

// some scsi op-codes
#define	SCSI_OP_TEST_UNIT_READY 0x00
#define SCSI_OP_REQUEST_SENSE 0x03
#define SCSI_OP_FORMAT 0x04
#define	SCSI_OP_READ_6 0x08
#define SCSI_OP_WRITE_6 0x0a
#define SCSI_OP_INQUIRY 0x12
#define SCSI_OP_MODE_SELECT_6 0x15
#define SCSI_OP_RESERVE 0x16
#define SCSI_OP_RELEASE 0x17
#define SCSI_OP_MODE_SENSE_6 0x1a
#define SCSI_OP_START_STOP 0x1b
#define	SCSI_OP_RECEIVE_DIAGNOSTIC 0x1c
#define	SCSI_OP_SEND_DIAGNOSTIC 0x1d
#define SCSI_OP_PREVENT_ALLOW 0x1e
#define	SCSI_OP_READ_CAPACITY 0x25
#define	SCSI_OP_READ_10 0x28
#define SCSI_OP_WRITE_10 0x2a
#define SCSI_OP_POSITION_TO_ELEMENT 0x2b
#define SCSI_OP_VERIFY 0x2f
#define	SCSI_OP_SYNCHRONIZE_CACHE 0x35
#define	SCSI_OP_WRITE_BUFFER 0x3b
#define	SCSI_OP_READ_BUFFER 0x3c
#define	SCSI_OP_CHANGE_DEFINITION 0x40
#define SCSI_OP_READ_SUB_CHANNEL 0x42
#define SCSI_OP_READ_TOC 0x43
#define SCSI_OP_PLAY_MSF 0x47
#define SCSI_OP_PLAY_AUDIO_TRACK_INDEX 0x48	// obsolete, spec missing
#define SCSI_OP_PAUSE_RESUME 0x4b
#define SCSI_OP_STOP_PLAY 0x4e
#define	SCSI_OP_MODE_SELECT_10 0x55
#define	SCSI_OP_MODE_SENSE_10 0x5A
#define SCSI_OP_MOVE_MEDIUM 0xa5
#define SCSI_OP_READ_12 0xa8
#define SCSI_OP_WRITE_12 0xaa
#define SCSI_OP_READ_ELEMENT_STATUS 0xb8
#define SCSI_OP_SCAN 0xba
#define SCSI_OP_READ_CD 0xbe
#define	SCSI_OP_TEST_UNIT_READY				0x00
#define SCSI_OP_REQUEST_SENSE				0x03
#define SCSI_OP_FORMAT						0x04
#define	SCSI_OP_READ_6						0x08
#define SCSI_OP_WRITE_6						0x0a
#define SCSI_OP_INQUIRY						0x12
#define SCSI_OP_MODE_SELECT_6				0x15
#define SCSI_OP_RESERVE						0x16
#define SCSI_OP_RELEASE						0x17
#define SCSI_OP_MODE_SENSE_6				0x1a
#define SCSI_OP_START_STOP					0x1b
#define	SCSI_OP_RECEIVE_DIAGNOSTIC			0x1c
#define	SCSI_OP_SEND_DIAGNOSTIC				0x1d
#define SCSI_OP_PREVENT_ALLOW				0x1e
#define	SCSI_OP_READ_CAPACITY				0x25
#define	SCSI_OP_READ_10						0x28
#define SCSI_OP_WRITE_10					0x2a
#define SCSI_OP_POSITION_TO_ELEMENT			0x2b
#define SCSI_OP_VERIFY						0x2f
#define	SCSI_OP_SYNCHRONIZE_CACHE			0x35
#define	SCSI_OP_WRITE_BUFFER				0x3b
#define	SCSI_OP_READ_BUFFER					0x3c
#define	SCSI_OP_CHANGE_DEFINITION			0x40
#define SCSI_OP_READ_SUB_CHANNEL			0x42
#define SCSI_OP_READ_TOC					0x43
#define SCSI_OP_PLAY_MSF					0x47
#define SCSI_OP_PLAY_AUDIO_TRACK_INDEX		0x48	// obsolete, spec missing
#define SCSI_OP_PAUSE_RESUME				0x4b
#define SCSI_OP_STOP_PLAY					0x4e
#define	SCSI_OP_MODE_SELECT_10				0x55
#define	SCSI_OP_MODE_SENSE_10				0x5A
#define SCSI_OP_READ_16						0x88
#define SCSI_OP_WRITE_16					0x8a
#define SCSI_OP_SERVICE_ACTION_IN			0x9e
#define SCSI_OP_SERVICE_ACTION_OUT			0x9f
#define SCSI_OP_MOVE_MEDIUM					0xa5
#define SCSI_OP_READ_12						0xa8
#define SCSI_OP_WRITE_12					0xaa
#define SCSI_OP_READ_ELEMENT_STATUS			0xb8
#define SCSI_OP_SCAN						0xba
#define SCSI_OP_READ_CD						0xbe

// Service-Action-In defines
#define SCSI_SAI_READ_CAPACITY_16			0x10


// INQUIRY

@@ -193,7 +239,7 @@
		response_data_format : 4,		// 2 = SCSI/2 compliant
		_res3_4 : 2,
		term_iop : 1,					// 1 = supports TERMINATE I/O PROCESS
		async_enc : 1					// processor devices only : 
		async_enc : 1					// processor devices only :
										// Asynchronous Event Notification Capable
	);
	uint8	additional_length;			// total (whished) length = this + 4
@@ -370,19 +416,19 @@
	LBITFIELD8_5(
		sense_key : 4,
		res2_4 : 1,
		ILI : 1,							// incorrect length indicator - req. block 
		ILI : 1,							// incorrect length indicator - req. block
											// length doesn't match physical block length
		EOM : 1,							// serial devices only
		Filemark : 1						// optional for random access
	);
	

	uint8 highest_inf;						// device-type or command specific
	uint8 high_inf;							// device-type 0, 4, 5, 7: block address
	uint8 mid_inf;							// device-type 1, 2, 3: req length - act. length
	uint8 low_inf;							// (and others for sequential dev. and COPY cmds
	

	uint8 add_sense_length; 				// total length = this + 7
	

	uint8 highest_cmd_inf;
	uint8 high_cmd_inf;
	uint8 mid_cmd_inf;
@@ -390,7 +436,7 @@
	uint8 asc;
	uint8 ascq;								// this can be zero if unsupported
	uint8 unit_code;						// != 0 to specify internal device unit
	

	union {
		struct {
		LBITFIELD8_2(
@@ -400,7 +446,7 @@
		uint8 mid_key_spec;
		uint8 low_key_spec;
		} raw;
		

		// ILLEGAL REQUEST
		struct {
		LBITFIELD8_5(
@@ -418,22 +464,22 @@
		struct {
		LBITFIELD8_2(
			res15_0 : 7,
			SKSV : 1	
			SKSV : 1
		);
		uint8 high_retry_cnt;
		uint8 low_retry_cnt;
		} acc_error;
		

		// format progress (if sense key = NOT READY)
		struct {
		LBITFIELD8_2(
			res15_0 : 7,
			SKSV : 1	
			SKSV : 1
		);
		uint16	progress;				// 0 = start, 0xffff = almost finished
		} format_progress;
	} sense_key_spec;
		

	// starting with offset 18 there are additional sense byte
} _PACKED scsi_sense;

@@ -625,13 +671,13 @@
		UAAENP : 1,			// unit attention AEN permission; true = send AEN,
							// false = generate UA condition (for everything but init.)
		RAENP : 1,			// ready AEN permission; true = send async event notification
							// (AEN) instead of generating an Unit Attention (UA) Condition 
							// (AEN) instead of generating an Unit Attention (UA) Condition
							// after initialization
		res4_3 : 4,
		EECA : 1			// enable Extended Contingent Allegiance
	);
	uint8 res5;
	uint8 high_AEN_holdoff;	// ready AEN hold off period - delay in ms between 
	uint8 high_AEN_holdoff;	// ready AEN hold off period - delay in ms between
	uint8 low_AEN_holdoff;	// initialization and AEN
} scsi_modepage_control;

@@ -897,7 +943,7 @@
} _PACKED scsi_cmd_pause_resume;


// SCAN 
// SCAN

typedef struct scsi_cmd_scan {
	uint8	opcode;
@@ -947,7 +993,7 @@
		_res9_0 : 1,
		error_field : 2,
		edc_ecc : 1,			// include EDC/ECC; includes 8 byte padding for Mode 1 format
		user_data : 1,			// if 1, include user data 
		user_data : 1,			// if 1, include user data
								// (mode select block size is ignored)
		header_code : 2,
		sync : 1				// if 1, include sync field from sector
@@ -962,7 +1008,7 @@
// possible values for header_code
enum scsi_read_cd_header_code {
	scsi_read_cd_header_none			= 0,
	scsi_read_cd_header_hdr_only		= 1,	
	scsi_read_cd_header_hdr_only		= 1,
	scsi_read_cd_header_sub_header_only	= 2,
	scsi_read_cd_header_all_headers		= 3,
};
@@ -994,9 +1040,10 @@
		lun : 3
	);
	scsi_cd_lba lba;
	uint8	_res2;	
	uint8	_res2;
	uint16	block_count;		// big endian
	uint8	control;
} _PACKED scsi_cmd_sync_cache;


#endif	/* _SCSI_CMDS_H */
diff --git a/src/apps/aboutsystem/AboutSystem.cpp b/src/apps/aboutsystem/AboutSystem.cpp
index 6bc18fb..e54ca0b 100644
--- a/src/apps/aboutsystem/AboutSystem.cpp
+++ b/src/apps/aboutsystem/AboutSystem.cpp
@@ -492,13 +492,16 @@
		B_ALIGN_VERTICAL_UNSET));

	// GCC version
#if __GNUC__ != 2

	snprintf(string, sizeof(string), "GCC %d", __GNUC__);
	BEntry gccFourHybrid("/boot/system/lib/gcc2/libstdc++.r4.so");
	BEntry gccTwoHybrid("/boot/system/lib/gcc4/libsupc++.so");
	if (gccFourHybrid.Exists() || gccTwoHybrid.Exists())
		snprintf(string, sizeof(string), TR("GCC %d Hybrid"), __GNUC__);
	else
		snprintf(string, sizeof(string), "GCC %d", __GNUC__);

	BStringView* gccView = new BStringView("gcctext", string);
	gccView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
		B_ALIGN_VERTICAL_UNSET));
#endif

	// CPU count, type and clock speed
	char processorLabel[256];
@@ -560,9 +563,7 @@
			.AddGroup(B_VERTICAL)
				.Add(_CreateLabel("oslabel", TR("Version:")))
				.Add(versionView)
#if __GNUC__ != 2

				.Add(gccView)
#endif
				.AddStrut(offset)
				.Add(_CreateLabel("cpulabel", processorLabel))
				.Add(cpuView)
diff --git a/src/apps/deskcalc/CalcView.cpp b/src/apps/deskcalc/CalcView.cpp
index c23f7a5..7da8893 100644
--- a/src/apps/deskcalc/CalcView.cpp
+++ b/src/apps/deskcalc/CalcView.cpp
@@ -917,7 +917,7 @@
	}

	// render new result to display
	fExpressionTextView->SetExpression(value.String());
	fExpressionTextView->SetValue(value.String());
}


diff --git a/src/apps/deskcalc/ExpressionTextView.cpp b/src/apps/deskcalc/ExpressionTextView.cpp
index da3c6a5..8fd7940 100644
--- a/src/apps/deskcalc/ExpressionTextView.cpp
+++ b/src/apps/deskcalc/ExpressionTextView.cpp
@@ -30,7 +30,9 @@
	fKeypadLabels(""),
	fPreviousExpressions(20),
	fHistoryPos(0),
	fCurrentExpression("")
	fCurrentExpression(""),
	fCurrentValue(""),
	fChangesApplied(false)
{
	SetStylable(false);
	SetDoesUndo(true);
@@ -64,7 +66,7 @@
void
ExpressionTextView::KeyDown(const char* bytes, int32 numBytes)
{
	// handle expression history
	// Handle expression history
	if (bytes[0] == B_UP_ARROW) {
		PreviousExpression();
		return;
@@ -75,22 +77,30 @@
	}
	BString current = Text();

	// handle in InputTextView, except B_TAB
	// Handle in InputTextView, except B_TAB
	if (bytes[0] == '=')
		ApplyChanges();
	else if (bytes[0] != B_TAB)
		InputTextView::KeyDown(bytes, numBytes);

	// pass on to CalcView if this was a label on a key
	// Pass on to CalcView if this was a label on a key
	if (fKeypadLabels.FindFirst(bytes[0]) >= 0)
		fCalcView->FlashKey(bytes, numBytes);
	else if (bytes[0] == B_BACKSPACE)
		fCalcView->FlashKey("BS", 2);

	// as soon as something is typed, we are at the
	// end of the expression history
	// As soon as something is typed, we are at the end of the expression
	// history.
	if (current != Text())
		fHistoryPos = fPreviousExpressions.CountItems();
		
	// If changes where not applied the value has become a new expression
	// note that even if only the left or right arrow keys are pressed the
	// fCurrentValue string will be cleared.
	if (!fChangesApplied)
		fCurrentValue.SetTo("");
	else
		fChangesApplied = false;
}


@@ -117,6 +127,17 @@
}


void
ExpressionTextView::SetTextRect(BRect rect)
{
	InputTextView::SetTextRect(rect);
	
	int32 count = fPreviousExpressions.CountItems();
	if (fHistoryPos == count && fCurrentValue.CountChars() > 0)
		SetValue(fCurrentValue.String());
}


// #pragma mark -


@@ -133,6 +154,7 @@
	AddExpressionToHistory(Text());
	fCalcView->FlashKey("=", 1);
	fCalcView->Evaluate();
	fChangesApplied = true;
}


@@ -152,6 +174,142 @@
	SetText(expression);
	int32 lastPos = strlen(expression);
	Select(lastPos, lastPos);
}


void
ExpressionTextView::SetValue(BString value)
{
	// save the value
	fCurrentValue = value;

	// calculate the width of the string
	BFont font;
	uint32 mode = B_FONT_ALL;
	GetFontAndColor(&font, &mode);
	float stringWidth = font.StringWidth(value);
	
	// make the string shorter if it does not fit in the view
	float viewWidth = Frame().Width();
	if (value.CountChars() > 3 && stringWidth > viewWidth) {
		// get the position of the first digit
		int32 firstDigit = 0;
		if (value[0] == '-')
			firstDigit++;

		// calculate the value of the exponent
		int32 exponent = 0;
		int32 offset = value.FindFirst('.');
		if (offset == B_ERROR) {
			exponent = value.CountChars() - 1 - firstDigit;
			value.Insert('.', 1, firstDigit + 1);
		} else {
			if (offset == firstDigit + 1) {
				// if the value is 0.01 or larger then scientific notation
				// won't shorten the string
				if (value[firstDigit] != '0' || value[firstDigit+2] != '0' 
					|| value[firstDigit + 3] != '0') {
					exponent = 0;
				} else {
					// remove the period
					value.Remove(offset, 1);
					
					// check for negative exponent value
					exponent = 0;
					while (value[firstDigit] == '0') {
						value.Remove(firstDigit, 1);
						exponent--;
					}
					
					// add the period
					value.Insert('.', 1, firstDigit + 1);
				}
			} else {
				// if the period + 1 digit fits in the view scientific notation
				// won't shorten the string
				BString temp = value;
				temp.Truncate(offset + 2);
				stringWidth = font.StringWidth(temp);
				if (stringWidth < viewWidth)
					exponent = 0;
				else {
					// move the period
					value.Remove(offset, 1);
					value.Insert('.', 1, firstDigit + 1);
					
					exponent = offset - (firstDigit + 1);
				}
			}
		}
		
		// add the exponent
		offset = value.CountChars() - 1;
		if (exponent != 0)
			value << "E" << exponent;
		
		// reduce the number of digits until the string fits or can not be
		// made any shorter
		stringWidth = font.StringWidth(value);
		char lastRemovedDigit = '0';
		while (offset > firstDigit && stringWidth > viewWidth) {
			if (value[offset] != '.')	
				lastRemovedDigit = value[offset];
			value.Remove(offset--, 1);
			stringWidth = font.StringWidth(value);
		}
		
		// there is no need to keep the period if no digits follow
		if (value[offset] == '.') {
			value.Remove(offset, 1);
			offset--;
		}
		
		// take care of proper rounding of the result
		int digit = (int)lastRemovedDigit - '0'; // ascii to int
		if (digit >= 5) {
			for (; offset >= firstDigit; offset--) {
				if (value[offset] == '.')
					continue;
				digit = (int)(value[offset]) - '0' + 1; // ascii to int + 1
				if (digit != 10)
					break;
				value.Remove(offset, 1);
			}
			if (digit == 10) {
				// carry over, shift the result
				if (value[firstDigit+1] == '.') {
					value[firstDigit+1] = '0';
					value[firstDigit] = '.';
				}
				value.Insert('1', 1, firstDigit);
				
				// remove the exponent value and the last digit
				offset = value.FindFirst('E');
				if (offset == B_ERROR) 
					offset = value.CountChars();
				value.Truncate(--offset);
				offset--; // offset now points to the last digit
				
				// increase the exponent and add it back to the string
				exponent++;
				value << 'E' << exponent;
			} else {
				// increase the current digit value with one
				value[offset] = char(digit + 48);
			}
		}
		
		// remove trailing zeros
		while (value[offset] == '0')
			value.Remove(offset--, 1);
		
		// there is no need to keep the period if no digits follow
		if (value[offset] == '.')
			value.Remove(offset, 1);
	}

	// set the new value	
	SetExpression(value);
}


diff --git a/src/apps/deskcalc/ExpressionTextView.h b/src/apps/deskcalc/ExpressionTextView.h
index ad3ae1a..6e69d3e 100644
--- a/src/apps/deskcalc/ExpressionTextView.h
+++ b/src/apps/deskcalc/ExpressionTextView.h
@@ -32,6 +32,7 @@
	virtual	void				GetDragParameters(BMessage* dragMessage,
									BBitmap** bitmap, BPoint* point,
									BHandler** handler);
			void 				SetTextRect(BRect rect);

	// InputTextView
	virtual	void				RevertChanges();
@@ -41,6 +42,7 @@
			void				AddKeypadLabel(const char* label);

			void				SetExpression(const char* expression);
			void				SetValue(BString value);

			void				BackSpace();
			void				Clear();
@@ -59,6 +61,9 @@
			BList				fPreviousExpressions;
			int32				fHistoryPos;
			BString				fCurrentExpression;
			BString				fCurrentValue;
			
			bool				fChangesApplied;
};

#endif // EXPRESSION_TEXT_VIEW_H
diff --git a/src/apps/installer/haikulogo.png b/src/apps/installer/haikulogo.png
index b59fa2d7c5a39726ab2acc19db1cff2ce235d256..870705d1b124dfbc765c8f7f0adce21f8d7e08f4 100644
Binary files a/src/apps/installer/haikulogo.png and b/src/apps/installer/haikulogo.png differdiff --git a/src/bin/less/defines.h b/src/bin/less/defines.h
index 592fe64..e10bc3c 100644
--- a/src/bin/less/defines.h
+++ b/src/bin/less/defines.h
@@ -197,7 +197,7 @@


/* Define EDIT_PGM to your editor. */
#define EDIT_PGM "vi"
#define EDIT_PGM "nano"

/* Define HAVE_CONST if your compiler supports the "const" modifier. */
#define HAVE_CONST 1
diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp
index 2eeea84..99cbc67 100644
--- a/src/kits/interface/Menu.cpp
+++ b/src/kits/interface/Menu.cpp
@@ -398,7 +398,7 @@
	if (!fAttachAborted) {
		_CacheFontInfo();
		_LayoutItems(0);
		_UpdateWindowViewSize();
		_UpdateWindowViewSize(false);
	}
}

@@ -705,7 +705,7 @@
	if (LockLooper()) {
		if (!Window()->IsHidden()) {
			_LayoutItems(index);
			_UpdateWindowViewSize();
			_UpdateWindowViewSize(false);
			Invalidate();
		}
		UnlockLooper();
@@ -826,7 +826,7 @@
	if (locked && Window() != NULL && !Window()->IsHidden()) {
		// Make sure we update the layout if needed.
		_LayoutItems(index);
		_UpdateWindowViewSize();
		_UpdateWindowViewSize(false);
		Invalidate();
	}

@@ -1508,7 +1508,7 @@
			return false;
		}

		_UpdateWindowViewSize();
		_UpdateWindowViewSize(true);
		window->Show();

		if (selectFirstItem)
@@ -1990,7 +1990,7 @@
		InvalidateLayout();
		if (locked && window != NULL) {
			_LayoutItems(0);
			_UpdateWindowViewSize();
			_UpdateWindowViewSize(false);
			Invalidate();
		}
	}
@@ -2300,7 +2300,7 @@
	if (!scroll) {
		// basically, if this returns false, it means
		// that the menu frame won't fit completely inside the screen
		// TODO: Scrolling, will currently only work up/down,
		// TODO: Scrolling will currently only work up/down,
		// not left/right
		scroll = screenFrame.Height() < frame.Height();
	}
@@ -2684,7 +2684,7 @@


void
BMenu::_UpdateWindowViewSize()
BMenu::_UpdateWindowViewSize(const bool &move)
{
	BMenuWindow* window = static_cast<BMenuWindow*>(Window());
	if (window == NULL)
@@ -2697,7 +2697,7 @@
		return;

	bool scroll = false;
	const BPoint screenLocation = ScreenLocation();
	const BPoint screenLocation = move ? ScreenLocation() : window->Frame().LeftTop();
	BRect frame = _CalcFrame(screenLocation, &scroll);
	ResizeTo(frame.Width(), frame.Height());

@@ -2728,7 +2728,8 @@
			fFontHeight + fPad.top + fPad.bottom);
	}

	window->MoveTo(frame.LeftTop());
	if (move)
		window->MoveTo(frame.LeftTop());
}


diff --git a/headers/private/system/arch/arm/arch_cpu_defs.h b/headers/private/system/arch/arm/arch_cpu_defs.h
new file mode 100644
index 0000000..180ef73 100644
--- /dev/null
+++ b/headers/private/system/arch/arm/arch_cpu_defs.h
@@ -1,0 +1,12 @@
/*
 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
 * Distributed under the terms of the MIT License.
 */
#ifndef _SYSTEM_ARCH_ARM_DEFS_H
#define _SYSTEM_ARCH_ARM_DEFS_H


#define SPINLOCK_PAUSE()	do {} while (false)


#endif	/* _SYSTEM_ARCH_ARM_DEFS_H */
diff --git a/headers/private/system/arch/m68k/arch_cpu_defs.h b/headers/private/system/arch/m68k/arch_cpu_defs.h
new file mode 100644
index 0000000..c3ddb13 100644
--- /dev/null
+++ b/headers/private/system/arch/m68k/arch_cpu_defs.h
@@ -1,0 +1,12 @@
/*
 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
 * Distributed under the terms of the MIT License.
 */
#ifndef _SYSTEM_ARCH_M68K_DEFS_H
#define _SYSTEM_ARCH_M68K_DEFS_H


#define SPINLOCK_PAUSE()	do {} while (false)


#endif	/* _SYSTEM_ARCH_M68K_DEFS_H */
diff --git a/headers/private/system/arch/mipsel/arch_cpu_defs.h b/headers/private/system/arch/mipsel/arch_cpu_defs.h
new file mode 100644
index 0000000..97d2477 100644
--- /dev/null
+++ b/headers/private/system/arch/mipsel/arch_cpu_defs.h
@@ -1,0 +1,12 @@
/*
 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
 * Distributed under the terms of the MIT License.
 */
#ifndef _SYSTEM_ARCH_MIPSEL_DEFS_H
#define _SYSTEM_ARCH_MIPSEL_DEFS_H


#define SPINLOCK_PAUSE()	do {} while (false)


#endif	/* _SYSTEM_ARCH_MIPSEL_DEFS_H */
diff --git a/headers/private/system/arch/ppc/arch_cpu_defs.h b/headers/private/system/arch/ppc/arch_cpu_defs.h
new file mode 100644
index 0000000..7191a7b 100644
--- /dev/null
+++ b/headers/private/system/arch/ppc/arch_cpu_defs.h
@@ -1,0 +1,12 @@
/*
 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
 * Distributed under the terms of the MIT License.
 */
#ifndef _SYSTEM_ARCH_PPC_DEFS_H
#define _SYSTEM_ARCH_PPC_DEFS_H


#define SPINLOCK_PAUSE()	do {} while (false)


#endif	/* _SYSTEM_ARCH_PPC_DEFS_H */
diff --git a/headers/private/system/arch/x86/arch_cpu_defs.h b/headers/private/system/arch/x86/arch_cpu_defs.h
new file mode 100644
index 0000000..e10ef98 100644
--- /dev/null
+++ b/headers/private/system/arch/x86/arch_cpu_defs.h
@@ -1,0 +1,12 @@
/*
 * Copyright 2010, Ingo Weinhold, ingo_weinhold@gmx.de.
 * Distributed under the terms of the MIT License.
 */
#ifndef _SYSTEM_ARCH_X86_DEFS_H
#define _SYSTEM_ARCH_X86_DEFS_H


#define SPINLOCK_PAUSE()	asm volatile("pause;")


#endif	/* _SYSTEM_ARCH_X86_DEFS_H */
diff --git a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp
index 578f619..33b7f29 100644
--- a/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp
+++ b/src/add-ons/kernel/bus_managers/ata/ATAChannel.cpp
@@ -755,7 +755,7 @@
	status_t result = B_OK;
	size_t *bytesLeft = request->BytesLeft();
	while (*bytesLeft > 0) {
		size_t currentLength = MIN(*bytesLeft, ATA_BLOCK_SIZE);
		size_t currentLength = MIN(*bytesLeft, request->Device()->BlockSize());
		if (request->IsWrite()) {
			result = _WritePIOBlock(request, currentLength);
			if (result != B_OK) {
diff --git a/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp b/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp
index abf3e9f..4317c8e 100644
--- a/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp
+++ b/src/add-ons/kernel/bus_managers/ata/ATADevice.cpp
@@ -17,9 +17,12 @@
	fUseDMA(channel->UseDMA()),
	fDMAMode(0),
	fDMAFailures(0),
	fTotalSectors(0),
	fBlockSize(512),
	fPhysicalBlockSize(512),
	fBlockOffset(0),
	fIndex(index),
	fUse48Bits(false),
	fTotalSectors(0)
	fUse48Bits(false)
{
	memset(&fInfoBlock, 0, sizeof(fInfoBlock));
	memset(&fTaskFile, 0, sizeof(fTaskFile));
@@ -170,7 +173,7 @@
	}

	scsi_res_read_capacity data;
	data.block_size = B_HOST_TO_BENDIAN_INT32(ATA_BLOCK_SIZE);
	data.block_size = B_HOST_TO_BENDIAN_INT32(fBlockSize);

	uint32 lastBlock = fTotalSectors - 1;
	data.lba = B_HOST_TO_BENDIAN_INT32(lastBlock);
@@ -305,12 +308,12 @@
ATADevice::Select()
{
	status_t err = fChannel->SelectDevice(fIndex);
#if 1	

    // for debugging only                                                                                                                                                                                                                      
#if 1

    // for debugging only
	if (fChannel->SelectedDevice() != fIndex) {
		TRACE_ERROR("device %d not selected!\n", fIndex);
		return B_ERROR;                                                                                                                                                                                                                    
	}                                                                                                                                                                                                                                          
		return B_ERROR;
	}
#endif
	return err;
}
@@ -442,6 +445,23 @@
	}

	fTotalSectors = fInfoBlock.lba_sector_count;

	if (fInfoBlock.word_106_bit_14_one && !fInfoBlock.word_106_bit_15_zero) {
		// contains a valid block size configuration
		if (fInfoBlock.logical_sector_not_512_bytes)
			fBlockSize = fInfoBlock.logical_sector_size * 2;

		if (fInfoBlock.multiple_logical_per_physical_sectors) {
			fPhysicalBlockSize
				= fBlockSize << fInfoBlock.logical_sectors_per_physical_sector;
		} else
			fPhysicalBlockSize = fBlockSize;
	}
	if (fInfoBlock.word_209_bit_14_one && !fInfoBlock.word_209_bit_15_zero) {
		// contains a valid logical block offset configuration
		fBlockOffset = fInfoBlock.logical_sector_offset;
	}

	fTaskFile.lba.mode = ATA_MODE_LBA;
	fTaskFile.lba.device = fIndex;

@@ -540,7 +560,7 @@
	if (!request->UseDMA())
		request->PrepareSGInfo();

	request->SetBytesLeft(sectorCount * ATA_BLOCK_SIZE);
	request->SetBytesLeft(sectorCount * fBlockSize);
	if (_FillTaskFile(request, address) != B_OK) {
		TRACE_ERROR("failed to setup transfer request\n");
		if (request->UseDMA())
@@ -615,7 +635,7 @@
		{ ATA_COMMAND_READ_DMA, ATA_COMMAND_WRITE_DMA }
	};

	uint32 sectorCount = *request->BytesLeft() / ATA_BLOCK_SIZE;
	uint32 sectorCount = *request->BytesLeft() / fBlockSize;
	TRACE("about to transfer %lu sectors\n", sectorCount);

	if (fUse48Bits
diff --git a/src/add-ons/kernel/bus_managers/ata/ATAInfoblock.h b/src/add-ons/kernel/bus_managers/ata/ATAInfoblock.h
index 51c9ca5..341a307 100644
--- a/src/add-ons/kernel/bus_managers/ata/ATAInfoblock.h
+++ b/src/add-ons/kernel/bus_managers/ata/ATAInfoblock.h
@@ -1,11 +1,14 @@
/*
 * Copyright 2010, Michael Lotz, mmlr@mlotz.ch.
 * Copyright 2009, Michael Lotz, mmlr@mlotz.ch.
 * Distributed under the terms of the MIT License.
 */
#ifndef ATA_INFOBLOCK_H
#define ATA_INFOBLOCK_H


#include <lendian_bitfield.h>


#define ATA_WORD_0_ATA_DEVICE		0
#define ATA_WORD_0_ATAPI_DEVICE		2
@@ -291,8 +294,23 @@

	uint16	word_95_99_reserved[5];
	uint64	lba48_sector_count;
	uint16	word_104_126_reserved[23];
	uint16	word_104_105_reserved[2];

	LBITFIELD6(
		logical_sectors_per_physical_sector		: 4,	// 2^x exponent
		word_106_bit_4_11_reserved				: 8,
		logical_sector_not_512_bytes			: 1,
		multiple_logical_per_physical_sectors	: 1,
		word_106_bit_14_one						: 1,
		word_106_bit_15_zero					: 1
	);

	uint16	word_107_116_reserved[10];

	uint32	logical_sector_size;						// in words, see 106

	uint16	word_119_126_reserved[8];

	LBITFIELD2(
		removable_media_status_supported_2		: 2,	// 1 = supported
		word_127_bit_2_15_reserved				: 14
@@ -322,7 +340,15 @@

	uint16	word_161_175_reserved_compact_flash_assoc[15];
	uint16	current_media_serial_number[30];
	uint16	word_206_254_reserved[49];
	uint16	word_206_208_reserved[3];

	LBITFIELD3(
		logical_sector_offset					: 14,
		word_209_bit_14_one						: 1,
		word_209_bit_15_zero					: 1
	);

	uint16	word_210_254_reserved[45];

	LBITFIELD2(
		signature								: 8,
diff --git a/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h b/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h
index c59ae4f..cdefd81 100644
--- a/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h
+++ b/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h
@@ -1,7 +1,7 @@
/*
 * Copyright 2009, Michael Lotz, mmlr@mlotz.ch.
 * Copyright 2008, Marcus Overhagen.
 * Copyright 2004-2008, Axel Dörfler, axeld@pinc-software.de.
 * Copyright 2004-2010, Axel Dörfler, axeld@pinc-software.de.
 * Copyright 2002-2003, Thomas Kurschel.
 *
 * Distributed under the terms of the MIT License.
@@ -9,6 +9,7 @@
#ifndef ATA_PRIVATE_H
#define ATA_PRIVATE_H


#include <ata_types.h>
#include <bus/ATA.h>
#include <bus/SCSI.h>
@@ -24,8 +25,8 @@
#include "ATACommands.h"
#include "ATAInfoblock.h"
#include "ATATracing.h"


#define ATA_BLOCK_SIZE				512 /* TODO: retrieve */
#define ATA_MAX_DMA_FAILURES		3
#define ATA_STANDARD_TIMEOUT		10 * 1000 * 1000
#define ATA_RELEASE_TIMEOUT			10 * 1000 * 1000
@@ -60,273 +61,277 @@

class ATAChannel {
public:
									ATAChannel(device_node *node);
									~ATAChannel();
								ATAChannel(device_node *node);
								~ATAChannel();

		status_t					InitCheck();
		uint32						ChannelID() { return fChannelID; };
			status_t			InitCheck();
			uint32				ChannelID() const { return fChannelID; }

		// SCSI stuff
		void						SetBus(scsi_bus bus);
		scsi_bus					Bus() { return fSCSIBus; };
		status_t					ScanBus();
			// SCSI stuff
			void				SetBus(scsi_bus bus);
			scsi_bus			Bus() const { return fSCSIBus; }
			status_t			ScanBus();

		void						PathInquiry(scsi_path_inquiry *info);
		void						GetRestrictions(uint8 targetID,
										bool *isATAPI, bool *noAutoSense,
										uint32 *maxBlocks);
		status_t					ExecuteIO(scsi_ccb *ccb);
			void				PathInquiry(scsi_path_inquiry *info);
			void				GetRestrictions(uint8 targetID, bool *isATAPI,
									bool *noAutoSense, uint32 *maxBlocks);
			status_t			ExecuteIO(scsi_ccb *ccb);

		// ATA stuff
		status_t					SelectDevice(uint8 index);
		uint8						SelectedDevice();
			// ATA stuff
			status_t			SelectDevice(uint8 index);
			uint8				SelectedDevice();

		status_t					Reset();
			status_t			Reset();

		bool						UseDMA() { return fUseDMA; };
			bool				UseDMA() const { return fUseDMA; }

		status_t					Wait(uint8 setBits, uint8 clearedBits,
										uint32 flags, bigtime_t timeout);
		status_t					WaitDataRequest(bool high);
		status_t					WaitDeviceReady();
		status_t					WaitForIdle();
			status_t			Wait(uint8 setBits, uint8 clearedBits,
									uint32 flags, bigtime_t timeout);
			status_t			WaitDataRequest(bool high);
			status_t			WaitDeviceReady();
			status_t			WaitForIdle();

		void						PrepareWaitingForInterrupt();
		status_t					WaitForInterrupt(bigtime_t timeout);
		status_t					RecoverLostInterrupt();
			void				PrepareWaitingForInterrupt();
			status_t			WaitForInterrupt(bigtime_t timeout);
			status_t			RecoverLostInterrupt();

		// request handling
		status_t					SendRequest(ATARequest *request,
										uint32 flags);
		status_t					FinishRequest(ATARequest *request,
										uint32 flags, uint8 errorMask);
			// request handling
			status_t			SendRequest(ATARequest *request, uint32 flags);
			status_t			FinishRequest(ATARequest *request, uint32 flags,
									uint8 errorMask);

		// data transfers
		status_t					PrepareDMA(ATARequest *request);
		status_t					StartDMA();
		status_t					FinishDMA();
			// data transfers
			status_t			PrepareDMA(ATARequest *request);
			status_t			StartDMA();
			status_t			FinishDMA();

		status_t					ExecutePIOTransfer(ATARequest *request);
			status_t			ExecutePIOTransfer(ATARequest *request);

		status_t					ReadRegs(ATADevice *device);
		uint8						AltStatus();
			status_t			ReadRegs(ATADevice *device);
			uint8				AltStatus();

		status_t					ReadPIO(uint8 *buffer, size_t length);
		status_t					WritePIO(uint8 *buffer, size_t length);
			status_t			ReadPIO(uint8 *buffer, size_t length);
			status_t			WritePIO(uint8 *buffer, size_t length);

		status_t					Interrupt(uint8 status);
			status_t			Interrupt(uint8 status);

private:
		status_t					_ReadRegs(ata_task_file *taskFile,
										ata_reg_mask mask);
		status_t					_WriteRegs(ata_task_file *taskFile,
										ata_reg_mask mask);
		status_t					_WriteControl(uint8 value);
		uint8						_Status();

		void						_FlushAndWait(bigtime_t waitTime);

		bool						_DevicePresent(int device);

		status_t					_ReadPIOBlock(ATARequest *request,
										size_t length);
		status_t					_WritePIOBlock(ATARequest *request,
										size_t length);
		status_t					_TransferPIOBlock(ATARequest *request,
										size_t length, size_t *transferred);
		status_t					_TransferPIOPhysical(ATARequest *request,
										addr_t physicalAddress, size_t length,
										size_t *transferred);
		status_t					_TransferPIOVirtual(ATARequest *request,
										uint8 *virtualAddress, size_t length,
										size_t *transferred);

		const char *				_DebugContext() { return fDebugContext; };

		device_node *				fNode;
		uint32						fChannelID;
		ata_controller_interface *	fController;
		void *						fCookie;

		spinlock					fInterruptLock;
		ConditionVariable			fInterruptCondition;
		ConditionVariableEntry		fInterruptConditionEntry;
		bool						fExpectsInterrupt;

		status_t					fStatus;
		scsi_bus					fSCSIBus;
		uint8						fDeviceCount;
		ATADevice **				fDevices;
		bool						fUseDMA;
		ATARequest *				fRequest;

		char						fDebugContext[16];
			status_t			_ReadRegs(ata_task_file *taskFile,
									ata_reg_mask mask);
			status_t			_WriteRegs(ata_task_file *taskFile,
									ata_reg_mask mask);
			status_t			_WriteControl(uint8 value);
			uint8				_Status();

			void				_FlushAndWait(bigtime_t waitTime);

			bool				_DevicePresent(int device);

			status_t			_ReadPIOBlock(ATARequest *request,
									size_t length);
			status_t			_WritePIOBlock(ATARequest *request,
									size_t length);
			status_t			_TransferPIOBlock(ATARequest *request,
									size_t length, size_t *transferred);
			status_t			_TransferPIOPhysical(ATARequest *request,
									addr_t physicalAddress, size_t length,
									size_t *transferred);
			status_t			_TransferPIOVirtual(ATARequest *request,
									uint8 *virtualAddress, size_t length,
									size_t *transferred);

			const char *		_DebugContext() { return fDebugContext; }

private:
			device_node *		fNode;
			uint32				fChannelID;
			ata_controller_interface *fController;
			void *				fCookie;

			spinlock			fInterruptLock;
			ConditionVariable	fInterruptCondition;
			ConditionVariableEntry fInterruptConditionEntry;
			bool				fExpectsInterrupt;

			status_t			fStatus;
			scsi_bus			fSCSIBus;
			uint8				fDeviceCount;
			ATADevice **		fDevices;
			bool				fUseDMA;
			ATARequest *		fRequest;

			char				fDebugContext[16];
};


class ATADevice {
public:
									ATADevice(ATAChannel *channel,
										uint8 index);
virtual								~ATADevice();

		// SCSI stuff
		status_t					ModeSense(ATARequest *request);
		status_t					TestUnitReady(ATARequest *request);
		status_t					SynchronizeCache(ATARequest *request);
		status_t					Eject(ATARequest *request);
		status_t					Inquiry(ATARequest *request);
		status_t					ReadCapacity(ATARequest *request);
virtual	status_t					ExecuteIO(ATARequest *request);

		void						GetRestrictions(bool *noAutoSense,
										uint32 *maxBlocks);

		// ATA stuff
virtual	bool						IsATAPI() { return false; };

		bool						UseDMA() { return fUseDMA; };
		bool						Use48Bits() { return fUse48Bits; };

		status_t					Select();

		ata_task_file *				TaskFile() { return &fTaskFile; };
		ata_reg_mask				RegisterMask() { return fRegisterMask; };

		status_t					SetFeature(int feature);
		status_t					DisableCommandQueueing();
		status_t					ConfigureDMA();

virtual	status_t					Configure();
		status_t					Identify();

		status_t					ExecuteReadWrite(ATARequest *request,
										uint64 address, uint32 sectorCount);

protected:
		const char *				_DebugContext() { return fDebugContext; };

		ATAChannel *				fChannel;
		ata_device_infoblock		fInfoBlock;
		ata_task_file				fTaskFile;
		ata_reg_mask				fRegisterMask;

		bool						fUseDMA;
		uint8						fDMAMode;
		uint8						fDMAFailures;

private:
		status_t					_FillTaskFile(ATARequest *request,
										uint64 address);

		uint8						fIndex;
		bool						fUse48Bits;
		uint64						fTotalSectors;

		char						fDebugContext[16];
								ATADevice(ATAChannel *channel, uint8 index);
	virtual						~ATADevice();

	// SCSI stuff
			status_t			ModeSense(ATARequest *request);
			status_t			TestUnitReady(ATARequest *request);
			status_t			SynchronizeCache(ATARequest *request);
			status_t			Eject(ATARequest *request);
			status_t			Inquiry(ATARequest *request);
			status_t			ReadCapacity(ATARequest *request);
	virtual	status_t			ExecuteIO(ATARequest *request);

			void				GetRestrictions(bool *noAutoSense,
									uint32 *maxBlocks);

	// ATA stuff
	virtual	bool				IsATAPI() const { return false; }

			bool				UseDMA() const { return fUseDMA; }
			bool				Use48Bits() const { return fUse48Bits; }
			size_t				BlockSize() const { return fBlockSize; }

			status_t			Select();

			ata_task_file *		TaskFile() { return &fTaskFile; }
			ata_reg_mask		RegisterMask() const { return fRegisterMask; }

			status_t			SetFeature(int feature);
			status_t			DisableCommandQueueing();
			status_t			ConfigureDMA();

	virtual	status_t			Configure();
			status_t			Identify();

			status_t			ExecuteReadWrite(ATARequest *request,
									uint64 address, uint32 sectorCount);

	protected:
			const char *		_DebugContext() { return fDebugContext; }

			ATAChannel *		fChannel;
			ata_device_infoblock fInfoBlock;
			ata_task_file		fTaskFile;
			ata_reg_mask		fRegisterMask;

			bool				fUseDMA;
			uint8				fDMAMode;
			uint8				fDMAFailures;

	private:
			status_t			_FillTaskFile(ATARequest *request,
									uint64 address);

			uint64				fTotalSectors;
			size_t				fBlockSize;
			size_t				fPhysicalBlockSize;
			size_t				fBlockOffset;
			uint8				fIndex;
			bool				fUse48Bits;

			char				fDebugContext[16];
};


class ATAPIDevice : public ATADevice {
public:
									ATAPIDevice(ATAChannel *channel,
										uint8 index);
virtual								~ATAPIDevice();
								ATAPIDevice(ATAChannel *channel, uint8 index);
	virtual						~ATAPIDevice();

			status_t			SendPacket(ATARequest *request);
	virtual	status_t			ExecuteIO(ATARequest *request);

		status_t					SendPacket(ATARequest *request);
virtual	status_t					ExecuteIO(ATARequest *request);
	virtual	bool				IsATAPI() const { return true; }

virtual	bool						IsATAPI() { return true; };
	virtual	status_t			Configure();

virtual	status_t					Configure();
	private:
			status_t			_FillTaskFilePacket(ATARequest *request);
			status_t			_FinishRequest(ATARequest *request,
									uint32 flags);

private:
		status_t					_FillTaskFilePacket(ATARequest *request);
		status_t					_FinishRequest(ATARequest *request,
										uint32 flags);

		uint8						fPacket[12];
			uint8				fPacket[12];
};


class ATARequest {
public:
									ATARequest(bool hasLock);
									~ATARequest();
								ATARequest(bool hasLock);
								~ATARequest();

		void						SetStatus(uint8 status);
		uint8						Status() { return fStatus; };
			void				SetStatus(uint8 status);
			uint8				Status() const { return fStatus; }

		void						ClearSense();
		void						SetSense(uint8 key, uint16 codeQualifier);
		uint8						SenseKey() { return fSenseKey; };
		uint8						SenseCode() { return fSenseCode; };
		uint8						SenseQualifier() { return fSenseQualifier; };
			void				ClearSense();
			void				SetSense(uint8 key, uint16 codeQualifier);
			uint8				SenseKey() const { return fSenseKey; }
			uint8				SenseCode() const { return fSenseCode; }
			uint8				SenseQualifier() const
									{ return fSenseQualifier; }

		void						SetDevice(ATADevice *device);
		ATADevice *					Device() { return fDevice; };
			void				SetDevice(ATADevice *device);
			ATADevice *			Device() const { return fDevice; }

		void						SetTimeout(bigtime_t timeout);
		bigtime_t					Timeout() { return fTimeout; };
			void				SetTimeout(bigtime_t timeout);
			bigtime_t			Timeout() const { return fTimeout; }

		void						SetIsWrite(bool isWrite);
		bool						IsWrite() { return fIsWrite; };
			void				SetIsWrite(bool isWrite);
			bool				IsWrite() const { return fIsWrite; }

		void						SetUseDMA(bool useDMA);
		bool						UseDMA() { return fUseDMA; };
			void				SetUseDMA(bool useDMA);
			bool				UseDMA() const { return fUseDMA; }

		void						SetBytesLeft(uint32 bytesLeft);
		size_t *					BytesLeft() { return &fBytesLeft; };
			void				SetBytesLeft(uint32 bytesLeft);
			size_t *			BytesLeft() { return &fBytesLeft; }

		bool						HasData() { return fCCB->data_length > 0; };
		bool						HasSense() { return fSenseKey != 0; };
			bool				HasData() const
									{ return fCCB->data_length > 0; }
			bool				HasSense() const { return fSenseKey != 0; }

		status_t					Finish(bool resubmit);
			status_t			Finish(bool resubmit);

		// SCSI stuff
		status_t					Start(scsi_ccb *ccb);
		scsi_ccb *					CCB() { return fCCB; };
			// SCSI stuff
			status_t			Start(scsi_ccb *ccb);
			scsi_ccb *			CCB() { return fCCB; }

		void						PrepareSGInfo();
		void						AdvanceSG(uint32 bytes);
			void				PrepareSGInfo();
			void				AdvanceSG(uint32 bytes);

		uint32						SGElementsLeft()
										{ return fSGElementsLeft; };
		const physical_entry *		CurrentSGElement()
										{ return fCurrentSGElement; };
		uint32						CurrentSGOffset()
										{ return fCurrentSGOffset; };
			uint32				SGElementsLeft() const
									{ return fSGElementsLeft; }
			const physical_entry *CurrentSGElement() const
									{ return fCurrentSGElement; }
			uint32				CurrentSGOffset() const
									{ return fCurrentSGOffset; }

		void						SetOddByte(uint8 byte);
		bool						GetOddByte(uint8 *byte);
			void				SetOddByte(uint8 byte);
			bool				GetOddByte(uint8 *byte);

		void						RequestSense();
			void				RequestSense();

private:
		void						_FillSense(scsi_sense *sense);

		const char *				_DebugContext() { return " request"; };

		mutex						fLock;
		bool						fHasLock;

		uint8						fStatus;
		uint8						fSenseKey;
		uint8						fSenseCode;
		uint8						fSenseQualifier;

		ATADevice *					fDevice;
		bigtime_t					fTimeout;
		size_t						fBytesLeft;
		bool						fIsWrite;
		bool						fUseDMA;
		scsi_ccb *					fCCB;

		uint32						fSGElementsLeft;
		const physical_entry *		fCurrentSGElement;
		uint32						fCurrentSGOffset;
		bool						fHasOddByte;
		uint8						fOddByte;
			void				_FillSense(scsi_sense *sense);

			const char *		_DebugContext() { return " request"; };

			mutex				fLock;
			bool				fHasLock;

			uint8				fStatus;
			uint8				fSenseKey;
			uint8				fSenseCode;
			uint8				fSenseQualifier;

			ATADevice *			fDevice;
			bigtime_t			fTimeout;
			size_t				fBytesLeft;
			bool				fIsWrite;
			bool				fUseDMA;
			scsi_ccb *			fCCB;

			uint32				fSGElementsLeft;
			const physical_entry *fCurrentSGElement;
			uint32				fCurrentSGOffset;
			bool				fHasOddByte;
			uint8				fOddByte;
};

#endif // ATA_PRIVATE_H
diff --git a/src/add-ons/kernel/bus_managers/scsi/bus_raw.c b/src/add-ons/kernel/bus_managers/scsi/bus_raw.c
index c81ab64..54bfab7 100644
--- a/src/add-ons/kernel/bus_managers/scsi/bus_raw.c
+++ b/src/add-ons/kernel/bus_managers/scsi/bus_raw.c
@@ -1,9 +1,11 @@
/*
 * Copyright 2002-04, Thomas Kurschel. All rights reserved.
 * Distributed under the terms of the MIT License.
 */


//!	Devfs entry for raw bus access.


#include "scsi_internal.h"

@@ -24,8 +26,9 @@


static status_t
scsi_bus_raw_init(device_node *node, void **cookie)
scsi_bus_raw_init(void *driverCookie, void **_cookie)
{
	device_node *node = (device_node *)driverCookie;
	device_node *parent;
	bus_raw_info *bus;

@@ -40,7 +43,7 @@

	bus->node = node;

	*cookie = bus;
	*_cookie = bus;
	return B_OK;
}

@@ -53,7 +56,7 @@


static status_t
scsi_bus_raw_open(void *bus, const char *path, uint32 flags,
scsi_bus_raw_open(void *bus, const char *path, int openMode,
	void **handle_cookie)
{
	*handle_cookie = bus;
@@ -76,7 +79,7 @@


static status_t
scsi_bus_raw_control(void *_cookie, int32 op, void *data, size_t length)
scsi_bus_raw_control(void *_cookie, uint32 op, void *data, size_t length)
{
	bus_raw_info *bus = _cookie;

diff --git a/src/add-ons/kernel/file_systems/ext2/Volume.cpp b/src/add-ons/kernel/file_systems/ext2/Volume.cpp
index 04c706e..1911dbb 100644
--- a/src/add-ons/kernel/file_systems/ext2/Volume.cpp
+++ b/src/add-ons/kernel/file_systems/ext2/Volume.cpp
@@ -278,6 +278,7 @@
	fBlockSize = 1UL << fSuperBlock.BlockShift();
	fFirstDataBlock = fSuperBlock.FirstDataBlock();

	fNumInodes = fSuperBlock.NumInodes();
	fNumGroups = (fSuperBlock.NumBlocks() - fFirstDataBlock - 1)
		/ fSuperBlock.BlocksPerGroup() + 1;
	fGroupsPerBlock = fBlockSize / sizeof(ext2_block_group);
diff --git a/src/add-ons/kernel/file_systems/ext2/Volume.h b/src/add-ons/kernel/file_systems/ext2/Volume.h
index 59b7458..cea51c9 100644
--- a/src/add-ons/kernel/file_systems/ext2/Volume.h
+++ b/src/add-ons/kernel/file_systems/ext2/Volume.h
@@ -38,6 +38,8 @@
			fs_volume*			FSVolume() const { return fFSVolume; }
			const char*			Name() const;

			uint32				NumInodes() const
									{ return fNumInodes; }
			off_t				NumBlocks() const
									{ return fSuperBlock.NumBlocks(); }
			off_t				FreeBlocks() const
@@ -74,6 +76,7 @@
			uint32				fBlockSize;
			uint32				fBlockShift;
			uint32				fFirstDataBlock;
			uint32				fNumInodes;
			uint32				fNumGroups;
			uint32				fGroupsPerBlock;
			ext2_block_group**	fGroupBlocks;
diff --git a/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp b/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
index 69c7ed3..ad2bb08 100644
--- a/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
+++ b/src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp
@@ -167,7 +167,7 @@
{
	Volume* volume = (Volume*)_volume->private_volume;

	if (id < 2 || id > volume->NumBlocks()) {
	if (id < 2 || id > volume->NumInodes()) {
		dprintf("ext2: inode at %Ld requested!\n", id);
		return B_ERROR;
	}
diff --git a/src/system/libroot/posix/pthread/pthread_spinlock.c b/src/system/libroot/posix/pthread/pthread_spinlock.c
index d9881fe..b0167b5 100644
--- a/src/system/libroot/posix/pthread/pthread_spinlock.c
+++ b/src/system/libroot/posix/pthread/pthread_spinlock.c
@@ -5,6 +5,9 @@


#include <pthread.h>

#include <arch_cpu_defs.h>

#include "pthread_private.h"


@@ -15,7 +18,7 @@
int
pthread_spin_init(pthread_spinlock_t* lock, int pshared)
{
	// this implementation of spinlocks doesn't differentiate
	// This implementation of spinlocks doesn't differentiate
	// between spin locks used by threads in the same process or
	// between threads of different processes.

@@ -34,8 +37,11 @@
int
pthread_spin_lock(pthread_spinlock_t* lock)
{
	while (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED) == LOCKED)
		; // spin
	while (atomic_test_and_set((int32*)&lock->lock, LOCKED, UNLOCKED)
			== LOCKED) {
		SPINLOCK_PAUSE(); // spin
			// TODO: On UP machines we should thread_yield() in the loop.
	}
	return 0;
}

diff --git a/src/add-ons/kernel/busses/scsi/ahci/Jamfile b/src/add-ons/kernel/busses/scsi/ahci/Jamfile
index 2022679..809a96e 100644
--- a/src/add-ons/kernel/busses/scsi/ahci/Jamfile
+++ b/src/add-ons/kernel/busses/scsi/ahci/Jamfile
@@ -1,7 +1,9 @@
SubDir HAIKU_TOP src add-ons kernel busses scsi ahci ;

UsePrivateHeaders drivers ;
UsePrivateKernelHeaders ;
UseHeaders
	[ FDirName $(HAIKU_TOP) src add-ons kernel bus_managers ata ] : true ;

KernelAddon ahci :
	ahci.c
@@ -10,4 +12,4 @@
	ahci_sim.cpp
	sata_request.cpp
	util.c
	;
;
diff --git a/src/add-ons/kernel/busses/scsi/ahci/ahci_port.cpp b/src/add-ons/kernel/busses/scsi/ahci/ahci_port.cpp
index e2521a5..b030b10 100644
--- a/src/add-ons/kernel/busses/scsi/ahci/ahci_port.cpp
+++ b/src/add-ons/kernel/busses/scsi/ahci/ahci_port.cpp
@@ -1,22 +1,26 @@
/*
 * Copyright 2007-2009, Marcus Overhagen. All rights reserved.
 * Distributed under the terms of the MIT License.
 */


#include "ahci_port.h"
#include "ahci_controller.h"
#include "util.h"
#include "ata_cmds.h"
#include "scsi_cmds.h"
#include "sata_request.h"

#include <KernelExport.h>
#include <ByteOrder.h>
#include <new>
#include <stdio.h>
#include <string.h>
#include <new>

#include <ByteOrder.h>
#include <KernelExport.h>

#include <ATAInfoblock.h>

#include "ahci_controller.h"
#include "ahci_tracing.h"
#include "sata_request.h"
#include "scsi_cmds.h"
#include "util.h"


#define TRACE_AHCI
#ifdef TRACE_AHCI
@@ -31,7 +35,8 @@


AHCIPort::AHCIPort(AHCIController *controller, int index)
	: fController(controller),
	:
	fController(controller),
	fIndex(index),
	fRegs(&controller->fRegs->port[index]),
	fArea(-1),
@@ -51,15 +56,15 @@
	fRequestSem = create_sem(1, "ahci request");
	fResponseSem = create_sem(0, "ahci response");
}
				


AHCIPort::~AHCIPort()
{
	delete_sem(fRequestSem);
	delete_sem(fResponseSem);
}


	
status_t
AHCIPort::Init1()
{
@@ -88,7 +93,7 @@
	virtAddr += sizeof(command_table);
	fPRDTable = (prd *)virtAddr;
	TRACE("PRD table is at %p\n", fPRDTable);
	

	fRegs->clb  = LO32(physAddr);
	fRegs->clbu = HI32(physAddr);
	physAddr += sizeof(command_list_entry) * COMMAND_LIST_ENTRY_COUNT;
@@ -116,7 +121,7 @@

	// activate link
	fRegs->cmd = (fRegs->cmd & ~PORT_CMD_ICC_MASK) | PORT_CMD_ICC_ACTIVE;
	

	// enable FIS receive
	fRegs->cmd |= PORT_CMD_FER;

@@ -157,7 +162,7 @@
}


void		
void
AHCIPort::Uninit()
{
	TRACE("AHCIPort::Uninit port %d\n", fIndex);
@@ -181,10 +186,10 @@

	// disable interrupts
	fRegs->ie = 0;
	

	// clear pending interrupts
	fRegs->is = fRegs->is;
	

	// invalidate DMA addresses
	fRegs->clb  = 0;
	fRegs->clbu = 0;
@@ -201,7 +206,7 @@
	if (fRegs->cmd & PORT_CMD_ST)
		TRACE("AHCIPort::ResetDevice PORT_CMD_ST set, behaviour undefined\n");

	// perform a hard reset 
	// perform a hard reset
	fRegs->sctl = (fRegs->sctl & ~0xf) | 1;
	FlushPostedWrites();
	spin(1100);
@@ -494,7 +499,7 @@
{
	acquire_sem(fRequestSem);
}
				


status_t
AHCIPort::WaitForTransfer(int *tfd, bigtime_t timeout)
@@ -543,7 +548,7 @@

	scsi_cmd_inquiry *cmd = (scsi_cmd_inquiry *)request->cdb;
	scsi_res_inquiry scsiData;
	ata_res_identify_device	ataData;
	ata_device_infoblock ataData;

	ASSERT(sizeof(ataData) == 512);

@@ -600,13 +605,13 @@
		sizeof(scsiData.product_rev));

	if (!fIsATAPI) {
		bool lba			= (ataData.words[49] & (1 << 9)) != 0;
		bool lba48			= (ataData.words[83] & (1 << 10)) != 0;
		uint32 sectors		= *(uint32*)&ataData.words[60];
		uint64 sectors48	= *(uint64*)&ataData.words[100];
		fUse48BitCommands   = lba && lba48;
		fSectorSize			= 512;
		fSectorCount		= !(lba || sectors) ? 0 : lba48 ? sectors48 : sectors;
		bool lba = ataData.dma_supported != 0;
		bool lba48 = ataData.lba48_supported != 0;
		uint32 sectors = ataData.lba_sector_count;
		uint64 sectors48 = ataData.lba48_sector_count;
		fUse48BitCommands = lba && lba48;
		fSectorSize = 512;
		fSectorCount = !(lba || sectors) ? 0 : lba48 ? sectors48 : sectors;
		TRACE("lba %d, lba48 %d, fUse48BitCommands %d, sectors %lu, "
			"sectors48 %llu, size %llu\n",
			lba, lba48, fUse48BitCommands, sectors, sectors48,
@@ -637,7 +642,7 @@
  	TRACE("firmware rev.: %s\n", firmwareRev);

	if (sg_memcpy(request->sg_list, request->sg_count, &scsiData,
		sizeof(scsiData)) < B_OK) {
			sizeof(scsiData)) < B_OK) {
		request->subsys_status = SCSI_DATA_RUN_ERR;
	} else {
		request->subsys_status = SCSI_REQ_CMP;
@@ -679,7 +684,8 @@
	scsiData.block_size = B_HOST_TO_BENDIAN_INT32(fSectorSize);
	scsiData.lba = B_HOST_TO_BENDIAN_INT32(fSectorCount - 1);

	if (sg_memcpy(request->sg_list, request->sg_count, &scsiData, sizeof(scsiData)) < B_OK) {
	if (sg_memcpy(request->sg_list, request->sg_count, &scsiData,
			sizeof(scsiData)) < B_OK) {
		request->subsys_status = SCSI_DATA_RUN_ERR;
	} else {
		request->subsys_status = SCSI_REQ_CMP;
@@ -690,10 +696,12 @@


void
AHCIPort::ScsiReadWrite(scsi_ccb *request, uint64 lba, size_t sectorCount, bool isWrite)
AHCIPort::ScsiReadWrite(scsi_ccb *request, uint64 lba, size_t sectorCount,
	bool isWrite)
{
	RWTRACE("[%lld] %ld ScsiReadWrite: position %llu, size %lu, isWrite %d\n",
		system_time(), find_thread(NULL), lba * 512, sectorCount * 512, isWrite);
		system_time(), find_thread(NULL), lba * 512, sectorCount * 512,
		isWrite);

#if 0

	if (isWrite) {
@@ -709,14 +717,18 @@
	sata_request *sreq = new(std::nothrow) sata_request(request);

	if (fUse48BitCommands) {
		if (sectorCount > 65536)
			panic("ahci: ScsiReadWrite length too large, %lu sectors", sectorCount);
		if (sectorCount > 65536) {
			panic("ahci: ScsiReadWrite length too large, %lu sectors",
				sectorCount);
		}
		if (lba > MAX_SECTOR_LBA_48)
			panic("achi: ScsiReadWrite position too large for 48-bit LBA\n");
		sreq->set_ata48_cmd(isWrite ? 0x35 : 0x25, lba, sectorCount);
	} else {
		if (sectorCount > 256)
			panic("ahci: ScsiReadWrite length too large, %lu sectors", sectorCount);
		if (sectorCount > 256) {
			panic("ahci: ScsiReadWrite length too large, %lu sectors",
				sectorCount);
		}
		if (lba > MAX_SECTOR_LBA_28)
			panic("achi: ScsiReadWrite position too large for normal LBA\n");
		sreq->set_ata28_cmd(isWrite ? 0xca : 0xc8, lba, sectorCount);
@@ -735,20 +747,20 @@

	int prdEntrys;

	if (request->ccb() && request->ccb()->data_length)
	if (request->ccb() && request->ccb()->data_length) {
		FillPrdTable(fPRDTable, &prdEntrys, PRD_TABLE_ENTRY_COUNT,
			request->ccb()->sg_list, request->ccb()->sg_count,
			request->ccb()->data_length);
	else if (request->data() && request->size())
	} else if (request->data() && request->size()) {
		FillPrdTable(fPRDTable, &prdEntrys, PRD_TABLE_ENTRY_COUNT,
			request->data(), request->size());
	else
	} else
		prdEntrys = 0;

	FLOW("prdEntrys %d\n", prdEntrys);

	fCommandList->prdtl_flags_cfl = 0;
	fCommandList->cfl = 5; // 20 bytes, length in DWORDS 
	fCommandList->cfl = 5; // 20 bytes, length in DWORDS
	memcpy((char *)fCommandTable->cfis, request->fis(), 20);

	fTestUnitReadyActive = request->is_test_unit_ready();
@@ -760,7 +772,7 @@
		fCommandList->a = 1;
	}

	if (isWrite) 
	if (isWrite)
		fCommandList->w = 1;
	fCommandList->prdtl = prdEntrys;
	fCommandList->prdbc = 0;
@@ -841,7 +853,7 @@
			default:
				panic("CDB has invalid direction mask");
		}
	

//		TRACE("AHCIPort::ScsiExecuteRequest ATAPI: port %d, opcode 0x%02x, length %u\n", fIndex, request->cdb[0], request->cdb_length);

		sata_request *sreq = new(std::nothrow) sata_request(request);
@@ -865,7 +877,7 @@
		gSCSI->finished(request, 1);
		return;
	}
	

	request->subsys_status = SCSI_REQ_CMP;

	switch (request->cdb[0]) {
@@ -885,7 +897,8 @@
		case SCSI_OP_WRITE_6:
		{
			scsi_cmd_rw_6 *cmd = (scsi_cmd_rw_6 *)request->cdb;
			uint32 position = ((uint32)cmd->high_lba << 16) | ((uint32)cmd->mid_lba << 8) | (uint32)cmd->low_lba;
			uint32 position = ((uint32)cmd->high_lba << 16)
				| ((uint32)cmd->mid_lba << 8) | (uint32)cmd->low_lba;
			size_t length = cmd->length != 0 ? cmd->length : 256;
			bool isWrite = request->cdb[0] == SCSI_OP_WRITE_6;
			ScsiReadWrite(request, position, length, isWrite);
@@ -901,7 +914,8 @@
			if (length) {
				ScsiReadWrite(request, position, length, isWrite);
			} else {
				TRACE("AHCIPort::ScsiExecuteRequest error: transfer without data!\n");
				TRACE("AHCIPort::ScsiExecuteRequest error: transfer without "
					"data!\n");
				request->subsys_status = SCSI_REQ_INVALID;
				gSCSI->finished(request, 1);
			}
@@ -917,14 +931,16 @@
			if (length) {
				ScsiReadWrite(request, position, length, isWrite);
			} else {
				TRACE("AHCIPort::ScsiExecuteRequest error: transfer without data!\n");
				TRACE("AHCIPort::ScsiExecuteRequest error: transfer without "
					"data!\n");
				request->subsys_status = SCSI_REQ_INVALID;
				gSCSI->finished(request, 1);
			}
			break;
		}
		default:
			TRACE("AHCIPort::ScsiExecuteRequest port %d unsupported request opcode 0x%02x\n", fIndex, request->cdb[0]);
			TRACE("AHCIPort::ScsiExecuteRequest port %d unsupported request "
				"opcode 0x%02x\n", fIndex, request->cdb[0]);
			request->subsys_status = SCSI_REQ_ABORTED;
			gSCSI->finished(request, 1);
	}
@@ -951,14 +967,15 @@
{
	return SCSI_REQ_CMP;
}


	
void
AHCIPort::ScsiGetRestrictions(bool *isATAPI, bool *noAutoSense, uint32 *maxBlocks)
AHCIPort::ScsiGetRestrictions(bool *isATAPI, bool *noAutoSense,
	uint32 *maxBlocks)
{
	*isATAPI = fIsATAPI;
	*noAutoSense = fIsATAPI; // emulated auto sense for ATA, but not ATAPI
	*maxBlocks = fUse48BitCommands ? 65536 : 256;
	TRACE("AHCIPort::ScsiGetRestrictions port %d: isATAPI %d, noAutoSense %d, maxBlocks %lu\n",
		fIndex, *isATAPI, *noAutoSense, *maxBlocks);
	TRACE("AHCIPort::ScsiGetRestrictions port %d: isATAPI %d, noAutoSense %d, "
		"maxBlocks %lu\n", fIndex, *isATAPI, *noAutoSense, *maxBlocks);
}
diff --git a/src/add-ons/kernel/busses/scsi/ahci/ata_cmds.h b/src/add-ons/kernel/busses/scsi/ahci/ata_cmds.h
deleted file mode 100644
index ce0239a..0000000 100644
--- a/src/add-ons/kernel/busses/scsi/ahci/ata_cmds.h
+++ /dev/null
@@ -1,20 +1,0 @@
#ifndef _ATA_CMDS_H
#define _ATA_CMDS_H

#include <SupportDefs.h>

struct ata_res_identify_device
{
	union {
		uint16 		words[256];
		struct {
			uint16	data1[10];
			char	serial_number[20];
			uint16	data2[3];
			char	firmware_revision[8];
			char	model_number[40];
		};
	};
};

#endif
diff --git a/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp b/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp
index 39fb601..c2750d4 100644
--- a/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp
+++ b/src/add-ons/kernel/busses/scsi/ahci/sata_request.cpp
@@ -1,30 +1,35 @@
/*
 * Copyright 2008, Marcus Overhagen. All rights reserved.
 * Distributed under the terms of the MIT License.
 */


#include <string.h>

#include "sata_request.h"
#include "scsi_cmds.h"
#include <string.h>


sata_request::sata_request()
 :	fCcb(NULL)
 ,	fIsATAPI(false)
 ,	fCompletionSem(create_sem(0, "sata completion"))
 ,	fCompletionStatus(0)
 ,	fData(NULL)
 ,	fDataSize(0)
	:
	fCcb(NULL),
	fIsATAPI(false),
	fCompletionSem(create_sem(0, "sata completion")),
	fCompletionStatus(0),
	fData(NULL),
	fDataSize(0)
{
}


sata_request::sata_request(scsi_ccb *ccb)
 :	fCcb(ccb)
 ,	fIsATAPI(false)
 ,	fCompletionSem(-1)
 ,	fCompletionStatus(0)
 ,	fData(NULL)
 ,	fDataSize(0)
	:
	fCcb(ccb),
	fIsATAPI(false),
	fCompletionSem(-1),
	fCompletionStatus(0),
	fData(NULL),
	fDataSize(0)
{
}

@@ -67,7 +72,7 @@
}


void 
void
sata_request::set_ata48_cmd(uint8 command, uint64 lba, uint16 sectorCount)
{
	set_ata_cmd(command);
@@ -122,13 +127,14 @@
			fCcb->subsys_status = SCSI_REQ_CMP_ERR;
			if (fIsATAPI) {
				if (!is_test_unit_ready()) {
					dprintf("ahci: sata_request::finish ATAPI packet %02x %02x %02x %02x "
						"%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x (len %d)\n",
					dprintf("ahci: sata_request::finish ATAPI packet %02x %02x "
						"%02x %02x %02x %02x %02x %02x %02x %02x %02x %02x "
						"%02x %02x %02x %02x (len %d)\n",
						fCcb->cdb[0], fCcb->cdb[1], fCcb->cdb[2], fCcb->cdb[3],
						fCcb->cdb[4], fCcb->cdb[5], fCcb->cdb[6], fCcb->cdb[7],
						fCcb->cdb[8], fCcb->cdb[9], fCcb->cdb[10], fCcb->cdb[11],
						fCcb->cdb[12], fCcb->cdb[13], fCcb->cdb[14], fCcb->cdb[15],
						fCcb->cdb_length);
						fCcb->cdb[8], fCcb->cdb[9], fCcb->cdb[10],
						fCcb->cdb[11], fCcb->cdb[12], fCcb->cdb[13],
						fCcb->cdb[14], fCcb->cdb[15], fCcb->cdb_length);
				}

				fCcb->device_status = SCSI_STATUS_CHECK_CONDITION;
@@ -189,9 +195,3 @@
	if (fCcb) panic("wrong usage");
	return fCompletionStatus;
}