Index: Makefile
diff -u Makefile:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/Makefile:1.1.1.1.2.2
--- Makefile:1.1.1.1	Mon Dec 16 03:14:27 2002
+++ Makefile	Mon May 12 09:51:00 2003
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 18
-EXTRAVERSION =
+EXTRAVERSION = -2.1-TS
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: TS-README
diff -u /dev/null TS-README:1.1.2.1
--- /dev/null	Fri May 16 09:07:11 2003
+++ TS-README	Mon May 12 08:47:41 2003
@@ -0,0 +1,18 @@
+Changed for TS Linux patch version 2.1
+
+Bug Fixes: 
+	21: Error handling in AtoD driver
+	16: make config failure
+
+Added to Default Config Files: 
+	parallel support
+	PPP
+	kernel versioning turned OFF
+	extended dumb serial support
+	    more than 4 serial ports supported
+		shareable interrupts enabled
+	ext3 built in support
+	resierFS (module)
+	provide NFSv3 client support
+	USB off in TSConfigFile (not TSConfigFile.5500)
+	
Index: TSConfigFile
diff -u /dev/null TSConfigFile:1.1.2.4
--- /dev/null	Fri May 16 09:07:11 2003
+++ TSConfigFile	Wed May 14 11:09:44 2003
@@ -0,0 +1,727 @@
+#
+# Automatically generated by make menuconfig: don't edit
+#
+CONFIG_X86=y
+CONFIG_ISA=y
+# CONFIG_SBUS is not set
+CONFIG_UID16=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# Processor type and features
+#
+CONFIG_M386=y
+# CONFIG_M486 is not set
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MELAN is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+# CONFIG_X86_CMPXCHG is not set
+# CONFIG_X86_XADD is not set
+CONFIG_X86_L1_CACHE_SHIFT=4
+CONFIG_RWSEM_GENERIC_SPINLOCK=y
+# CONFIG_RWSEM_XCHGADD_ALGORITHM is not set
+CONFIG_X86_PPRO_FENCE=y
+TSYSTEMS=y
+CONFIG_TS_M386=y
+# CONFIG_TOSHIBA is not set
+# CONFIG_I8K is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+CONFIG_NOHIGHMEM=y
+# CONFIG_HIGHMEM4G is not set
+# CONFIG_HIGHMEM64G is not set
+CONFIG_MATH_EMULATION=y
+# CONFIG_MTRR is not set
+# CONFIG_SMP is not set
+# CONFIG_X86_UP_APIC is not set
+# CONFIG_X86_UP_IOAPIC is not set
+
+#
+# General setup
+#
+CONFIG_NET=y
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+CONFIG_PCI_GODIRECT=y
+# CONFIG_PCI_GOANY is not set
+CONFIG_PCI_DIRECT=y
+# CONFIG_PCI_NAMES is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+# CONFIG_HOTPLUG is not set
+# CONFIG_PCMCIA is not set
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+CONFIG_BINFMT_AOUT=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_PM is not set
+# CONFIG_ACPI is not set
+# CONFIG_APM is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+# CONFIG_PARPORT_PC is not set
+# CONFIG_PARPORT_AMIGA is not set
+# CONFIG_PARPORT_MFC3 is not set
+# CONFIG_PARPORT_ATARI is not set
+# CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_SUNBPP is not set
+# CONFIG_PARPORT_OTHER is not set
+# CONFIG_PARPORT_1284 is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+# CONFIG_ISAPNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_NBD=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_BLK_DEV_MSYS_DOC=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+# CONFIG_BLK_DEV_MD is not set
+# CONFIG_MD_LINEAR is not set
+# CONFIG_MD_RAID0 is not set
+# CONFIG_MD_RAID1 is not set
+# CONFIG_MD_RAID5 is not set
+# CONFIG_MD_MULTIPATH is not set
+# CONFIG_BLK_DEV_LVM is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK_DEV is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+CONFIG_IP_PNP_BOOTP=y
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+
+#
+#   IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+# CONFIG_IP_NF_FTP is not set
+# CONFIG_IP_NF_IRC is not set
+# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=m
+# CONFIG_IP_NF_MATCH_LIMIT is not set
+# CONFIG_IP_NF_MATCH_MAC is not set
+# CONFIG_IP_NF_MATCH_MARK is not set
+# CONFIG_IP_NF_MATCH_MULTIPORT is not set
+# CONFIG_IP_NF_MATCH_TOS is not set
+# CONFIG_IP_NF_MATCH_AH_ESP is not set
+# CONFIG_IP_NF_MATCH_LENGTH is not set
+# CONFIG_IP_NF_MATCH_TTL is not set
+# CONFIG_IP_NF_MATCH_TCPMSS is not set
+# CONFIG_IP_NF_MATCH_STATE is not set
+# CONFIG_IP_NF_MATCH_UNCLEAN is not set
+# CONFIG_IP_NF_MATCH_OWNER is not set
+# CONFIG_IP_NF_FILTER is not set
+# CONFIG_IP_NF_NAT is not set
+# CONFIG_IP_NF_MANGLE is not set
+# CONFIG_IP_NF_TARGET_LOG is not set
+# CONFIG_IP_NF_TARGET_TCPMSS is not set
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+# CONFIG_PHONE_IXJ is not set
+# CONFIG_PHONE_IXJ_PCMCIA is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+CONFIG_IDE=y
+
+#
+# IDE, ATA and ATAPI Block devices
+#
+CONFIG_BLK_DEV_IDE=y
+CONFIG_BLK_DEV_HD_IDE=y
+CONFIG_BLK_DEV_HD=y
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
+# CONFIG_BLK_DEV_IDEDISK_FUJITSU is not set
+# CONFIG_BLK_DEV_IDEDISK_IBM is not set
+# CONFIG_BLK_DEV_IDEDISK_MAXTOR is not set
+# CONFIG_BLK_DEV_IDEDISK_QUANTUM is not set
+# CONFIG_BLK_DEV_IDEDISK_SEAGATE is not set
+# CONFIG_BLK_DEV_IDEDISK_WD is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_TIVO is not set
+# CONFIG_BLK_DEV_IDECS is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+# CONFIG_BLK_DEV_IDESCSI is not set
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_CMD640_ENHANCED is not set
+# CONFIG_BLK_DEV_ISAPNP is not set
+# CONFIG_BLK_DEV_RZ1000 is not set
+# CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_IDE_CHIPSETS is not set
+CONFIG_IDEDMA_AUTO=y
+# CONFIG_IDEDMA_IVB is not set
+# CONFIG_DMA_NONPCI is not set
+CONFIG_BLK_DEV_IDE_MODES=y
+# CONFIG_BLK_DEV_ATARAID is not set
+# CONFIG_BLK_DEV_ATARAID_PDC is not set
+# CONFIG_BLK_DEV_ATARAID_HPT is not set
+
+#
+# SCSI support
+#
+# CONFIG_SCSI is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_BOOT is not set
+# CONFIG_FUSION_ISENSE is not set
+# CONFIG_FUSION_CTL is not set
+# CONFIG_FUSION_LAN is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+# CONFIG_I2O_PCI is not set
+# CONFIG_I2O_BLOCK is not set
+# CONFIG_I2O_LAN is not set
+# CONFIG_I2O_SCSI is not set
+# CONFIG_I2O_PROC is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_SUNLANCE is not set
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNBMAC is not set
+# CONFIG_SUNQE is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+CONFIG_NET_ISA=y
+# CONFIG_E2100 is not set
+# CONFIG_EWRK3 is not set
+# CONFIG_EEXPRESS is not set
+# CONFIG_EEXPRESS_PRO is not set
+# CONFIG_HPLAN_PLUS is not set
+# CONFIG_HPLAN is not set
+# CONFIG_LP486E is not set
+# CONFIG_ETH16I is not set
+# CONFIG_NE2000 is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_AC3200 is not set
+# CONFIG_APRICOT is not set
+CONFIG_CS89x0=y
+# CONFIG_TULIP is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_DGRS is not set
+CONFIG_DM9102=y
+# CONFIG_EEPRO100 is not set
+# CONFIG_LNE390 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_NE3210 is not set
+# CONFIG_ES3210 is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_8139TOO_PIO is not set
+# CONFIG_8139TOO_TUNE_TWISTER is not set
+# CONFIG_8139TOO_8129 is not set
+# CONFIG_8139_NEW_RX_RESET is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_VIA_RHINE_MMIO is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_MYRI_SBUS is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+# CONFIG_PPP_FILTER is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Input core support
+#
+# CONFIG_INPUT is not set
+# CONFIG_INPUT_KEYBDEV is not set
+# CONFIG_INPUT_MOUSEDEV is not set
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_SERIAL_EXTENDED=y
+CONFIG_SERIAL_MANY_PORTS=y
+CONFIG_SERIAL_SHARE_IRQ=y
+# CONFIG_SERIAL_DETECT_IRQ is not set
+# CONFIG_SERIAL_MULTIPORT is not set
+# CONFIG_HUB6 is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+# CONFIG_PRINTER is not set
+# CONFIG_PPDEV is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+CONFIG_MOUSE=y
+CONFIG_PSMOUSE=y
+# CONFIG_82C710_MOUSE is not set
+# CONFIG_PC110_PAD is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
+# CONFIG_PCWATCHDOG is not set
+# CONFIG_ACQUIRE_WDT is not set
+# CONFIG_ADVANTECH_WDT is not set
+# CONFIG_EUROTECH_WDT is not set
+# CONFIG_IB700_WDT is not set
+# CONFIG_I810_TCO is not set
+# CONFIG_MIXCOMWD is not set
+# CONFIG_60XX_WDT is not set
+# CONFIG_W83877F_WDT is not set
+# CONFIG_MACHZ_WDT is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_MWAVE is not set
+# CONFIG_TSA2D is not set
+
+#
+# Multimedia devices
+#
+# CONFIG_VIDEO_DEV is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_ADFS_FS_RW is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_UMSDOS_FS=m
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_JFFS_FS is not set
+# CONFIG_JFFS2_FS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_TMPFS=y
+# CONFIG_RAMFS is not set
+# CONFIG_ISO9660_FS is not set
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_NTFS_RW is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+# CONFIG_DEVPTS_FS is not set
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_QNX4FS_RW is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UDF_RW is not set
+# CONFIG_UFS_FS is not set
+# CONFIG_UFS_FS_WRITE is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+# CONFIG_NFSD_V3 is not set
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_NCPFS_PACKET_SIGNING is not set
+# CONFIG_NCPFS_IOCTL_LOCKING is not set
+# CONFIG_NCPFS_STRONG is not set
+# CONFIG_NCPFS_NFS_NS is not set
+# CONFIG_NCPFS_OS2_NS is not set
+# CONFIG_NCPFS_SMALLDOS is not set
+# CONFIG_NCPFS_NLS is not set
+# CONFIG_NCPFS_EXTRAS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_SMB_NLS=y
+CONFIG_NLS=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Console drivers
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VIDEO_SELECT is not set
+# CONFIG_MDA_CONSOLE is not set
+
+#
+# Frame-buffer support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+# CONFIG_USB is not set
+# CONFIG_USB_UHCI_ALT is not set
+# CONFIG_USB_OHCI is not set
+# CONFIG_USB_AUDIO is not set
+# CONFIG_USB_BLUETOOTH is not set
+# CONFIG_USB_STORAGE is not set
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+# CONFIG_USB_STORAGE_SDDR09 is not set
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+# CONFIG_USB_ACM is not set
+# CONFIG_USB_PRINTER is not set
+# CONFIG_USB_DC2XX is not set
+# CONFIG_USB_MDC800 is not set
+# CONFIG_USB_SCANNER is not set
+# CONFIG_USB_MICROTEK is not set
+# CONFIG_USB_HPUSBSCSI is not set
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+# CONFIG_USB_SERIAL is not set
+# CONFIG_USB_SERIAL_GENERIC is not set
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+# CONFIG_USB_SERIAL_VISOR is not set
+# CONFIG_USB_SERIAL_IPAQ is not set
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set
+# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+# CONFIG_USB_RIO500 is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_DEBUG_KERNEL is not set
Index: TSConfigFile.5500
diff -u /dev/null TSConfigFile.5500:1.1.2.3
--- /dev/null	Fri May 16 09:07:11 2003
+++ TSConfigFile.5500	Mon May 12 08:29:10 2003
@@ -0,0 +1,860 @@
+#
+# Automatically generated make config: don't edit
+#
+CONFIG_X86=y
+CONFIG_ISA=y
+# CONFIG_SBUS is not set
+CONFIG_UID16=y
+
+#
+# Code maturity level options
+#
+CONFIG_EXPERIMENTAL=y
+
+#
+# Loadable module support
+#
+CONFIG_MODULES=y
+# CONFIG_MODVERSIONS is not set
+CONFIG_KMOD=y
+
+#
+# Processor type and features
+#
+# CONFIG_M386 is not set
+CONFIG_M486=y
+# CONFIG_M586 is not set
+# CONFIG_M586TSC is not set
+# CONFIG_M586MMX is not set
+# CONFIG_M686 is not set
+# CONFIG_MPENTIUMIII is not set
+# CONFIG_MPENTIUM4 is not set
+# CONFIG_MK6 is not set
+# CONFIG_MK7 is not set
+# CONFIG_MELAN is not set
+# CONFIG_MCRUSOE is not set
+# CONFIG_MWINCHIPC6 is not set
+# CONFIG_MWINCHIP2 is not set
+# CONFIG_MWINCHIP3D is not set
+# CONFIG_MCYRIXIII is not set
+CONFIG_X86_WP_WORKS_OK=y
+CONFIG_X86_INVLPG=y
+CONFIG_X86_CMPXCHG=y
+CONFIG_X86_XADD=y
+CONFIG_X86_BSWAP=y
+CONFIG_X86_POPAD_OK=y
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
+CONFIG_RWSEM_XCHGADD_ALGORITHM=y
+CONFIG_X86_L1_CACHE_SHIFT=4
+CONFIG_X86_USE_STRING_486=y
+CONFIG_X86_ALIGNMENT_16=y
+CONFIG_X86_PPRO_FENCE=y
+TSYSTEMS=y
+CONFIG_TS_M486=y
+# CONFIG_TOSHIBA is not set
+# CONFIG_I8K is not set
+# CONFIG_MICROCODE is not set
+# CONFIG_X86_MSR is not set
+# CONFIG_X86_CPUID is not set
+CONFIG_NOHIGHMEM=y
+# CONFIG_HIGHMEM4G is not set
+# CONFIG_HIGHMEM64G is not set
+CONFIG_MATH_EMULATION=y
+# CONFIG_MTRR is not set
+# CONFIG_SMP is not set
+# CONFIG_X86_UP_APIC is not set
+
+#
+# General setup
+#
+CONFIG_NET=y
+CONFIG_PCI=y
+# CONFIG_PCI_GOBIOS is not set
+CONFIG_PCI_GODIRECT=y
+# CONFIG_PCI_GOANY is not set
+CONFIG_PCI_DIRECT=y
+# CONFIG_PCI_NAMES is not set
+# CONFIG_EISA is not set
+# CONFIG_MCA is not set
+CONFIG_HOTPLUG=y
+
+#
+# PCMCIA/CardBus support
+#
+# CONFIG_PCMCIA is not set
+
+#
+# PCI Hotplug Support
+#
+# CONFIG_HOTPLUG_PCI is not set
+CONFIG_SYSVIPC=y
+# CONFIG_BSD_PROCESS_ACCT is not set
+CONFIG_SYSCTL=y
+CONFIG_KCORE_ELF=y
+# CONFIG_KCORE_AOUT is not set
+CONFIG_BINFMT_AOUT=y
+CONFIG_BINFMT_ELF=y
+CONFIG_BINFMT_MISC=y
+# CONFIG_PM is not set
+# CONFIG_APM_IGNORE_USER_SUSPEND is not set
+# CONFIG_APM_DO_ENABLE is not set
+# CONFIG_APM_CPU_IDLE is not set
+# CONFIG_APM_DISPLAY_BLANK is not set
+# CONFIG_APM_RTC_IS_GMT is not set
+# CONFIG_APM_ALLOW_INTS is not set
+# CONFIG_APM_REAL_MODE_POWER_OFF is not set
+
+#
+# Memory Technology Devices (MTD)
+#
+# CONFIG_MTD is not set
+
+#
+# Parallel port support
+#
+CONFIG_PARPORT=m
+# CONFIG_PARPORT_PC is not set
+# CONFIG_PARPORT_AMIGA is not set
+# CONFIG_PARPORT_MFC3 is not set
+# CONFIG_PARPORT_ATARI is not set
+# CONFIG_PARPORT_GSC is not set
+# CONFIG_PARPORT_SUNBPP is not set
+# CONFIG_PARPORT_OTHER is not set
+# CONFIG_PARPORT_1284 is not set
+
+#
+# Plug and Play configuration
+#
+# CONFIG_PNP is not set
+
+#
+# Block devices
+#
+# CONFIG_BLK_DEV_FD is not set
+# CONFIG_BLK_DEV_XD is not set
+# CONFIG_PARIDE is not set
+# CONFIG_BLK_CPQ_DA is not set
+# CONFIG_BLK_CPQ_CISS_DA is not set
+# CONFIG_BLK_DEV_DAC960 is not set
+CONFIG_BLK_DEV_LOOP=y
+CONFIG_BLK_DEV_NBD=y
+CONFIG_BLK_DEV_RAM=y
+CONFIG_BLK_DEV_RAM_SIZE=4096
+CONFIG_BLK_DEV_INITRD=y
+CONFIG_BLK_DEV_MSYS_DOC=m
+
+#
+# Multi-device support (RAID and LVM)
+#
+# CONFIG_MD is not set
+
+#
+# Networking options
+#
+CONFIG_PACKET=y
+# CONFIG_PACKET_MMAP is not set
+# CONFIG_NETLINK_DEV is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+# CONFIG_FILTER is not set
+CONFIG_UNIX=y
+CONFIG_INET=y
+# CONFIG_IP_MULTICAST is not set
+# CONFIG_IP_ADVANCED_ROUTER is not set
+CONFIG_IP_PNP=y
+CONFIG_IP_PNP_DHCP=y
+# CONFIG_IP_PNP_BOOTP is not set
+# CONFIG_IP_PNP_RARP is not set
+# CONFIG_NET_IPIP is not set
+# CONFIG_NET_IPGRE is not set
+# CONFIG_ARPD is not set
+# CONFIG_INET_ECN is not set
+# CONFIG_SYN_COOKIES is not set
+
+#
+#   IP: Netfilter Configuration
+#
+CONFIG_IP_NF_CONNTRACK=m
+# CONFIG_IP_NF_FTP is not set
+# CONFIG_IP_NF_IRC is not set
+# CONFIG_IP_NF_QUEUE is not set
+CONFIG_IP_NF_IPTABLES=m
+# CONFIG_IP_NF_MATCH_LIMIT is not set
+# CONFIG_IP_NF_MATCH_MAC is not set
+# CONFIG_IP_NF_MATCH_MARK is not set
+# CONFIG_IP_NF_MATCH_MULTIPORT is not set
+# CONFIG_IP_NF_MATCH_TOS is not set
+# CONFIG_IP_NF_MATCH_AH_ESP is not set
+# CONFIG_IP_NF_MATCH_LENGTH is not set
+# CONFIG_IP_NF_MATCH_TTL is not set
+# CONFIG_IP_NF_MATCH_TCPMSS is not set
+# CONFIG_IP_NF_MATCH_STATE is not set
+# CONFIG_IP_NF_MATCH_UNCLEAN is not set
+# CONFIG_IP_NF_MATCH_OWNER is not set
+# CONFIG_IP_NF_FILTER is not set
+# CONFIG_IP_NF_NAT is not set
+# CONFIG_IP_NF_MANGLE is not set
+# CONFIG_IP_NF_TARGET_LOG is not set
+# CONFIG_IP_NF_TARGET_ULOG is not set
+# CONFIG_IP_NF_TARGET_TCPMSS is not set
+# CONFIG_IP_NF_COMPAT_IPCHAINS is not set
+# CONFIG_IP_NF_COMPAT_IPFWADM is not set
+# CONFIG_IPV6 is not set
+# CONFIG_KHTTPD is not set
+# CONFIG_ATM is not set
+# CONFIG_VLAN_8021Q is not set
+
+#
+#  
+#
+# CONFIG_IPX is not set
+# CONFIG_ATALK is not set
+# CONFIG_DECNET is not set
+# CONFIG_BRIDGE is not set
+# CONFIG_X25 is not set
+# CONFIG_LAPB is not set
+# CONFIG_LLC is not set
+# CONFIG_NET_DIVERT is not set
+# CONFIG_ECONET is not set
+# CONFIG_WAN_ROUTER is not set
+# CONFIG_NET_FASTROUTE is not set
+# CONFIG_NET_HW_FLOWCONTROL is not set
+
+#
+# QoS and/or fair queueing
+#
+# CONFIG_NET_SCHED is not set
+
+#
+# Telephony Support
+#
+# CONFIG_PHONE is not set
+
+#
+# ATA/IDE/MFM/RLL support
+#
+CONFIG_IDE=y
+
+#
+# IDE, ATA and ATAPI Block devices
+#
+CONFIG_BLK_DEV_IDE=y
+
+#
+# Please see Documentation/ide.txt for help/info on IDE drives
+#
+CONFIG_BLK_DEV_HD_IDE=y
+CONFIG_BLK_DEV_HD=y
+CONFIG_BLK_DEV_IDEDISK=y
+# CONFIG_IDEDISK_MULTI_MODE is not set
+# CONFIG_BLK_DEV_IDEDISK_VENDOR is not set
+# CONFIG_BLK_DEV_COMMERIAL is not set
+# CONFIG_BLK_DEV_IDECD is not set
+# CONFIG_BLK_DEV_IDETAPE is not set
+# CONFIG_BLK_DEV_IDEFLOPPY is not set
+CONFIG_BLK_DEV_IDESCSI=m
+
+#
+# IDE chipset support/bugfixes
+#
+# CONFIG_BLK_DEV_CMD640 is not set
+# CONFIG_BLK_DEV_RZ1000 is not set
+# CONFIG_BLK_DEV_IDEPCI is not set
+# CONFIG_IDE_CHIPSETS is not set
+# CONFIG_IDEDMA_AUTO is not set
+# CONFIG_DMA_NONPCI is not set
+# CONFIG_BLK_DEV_IDE_MODES is not set
+# CONFIG_BLK_DEV_ATARAID is not set
+
+#
+# SCSI support
+#
+CONFIG_SCSI=m
+
+#
+# SCSI support type (disk, tape, CD-ROM)
+#
+CONFIG_BLK_DEV_SD=m
+CONFIG_SD_EXTRA_DEVS=10
+# CONFIG_CHR_DEV_ST is not set
+# CONFIG_CHR_DEV_OSST is not set
+# CONFIG_BLK_DEV_SR is not set
+# CONFIG_CHR_DEV_SG is not set
+
+#
+# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
+#
+# CONFIG_SCSI_DEBUG_QUEUES is not set
+CONFIG_SCSI_MULTI_LUN=y
+# CONFIG_SCSI_CONSTANTS is not set
+# CONFIG_SCSI_LOGGING is not set
+
+#
+# SCSI low-level drivers
+#
+# CONFIG_BLK_DEV_3W_XXXX_RAID is not set
+# CONFIG_SCSI_7000FASST is not set
+# CONFIG_SCSI_ACARD is not set
+# CONFIG_SCSI_AHA152X is not set
+# CONFIG_SCSI_AHA1542 is not set
+# CONFIG_SCSI_AHA1740 is not set
+# CONFIG_SCSI_AACRAID is not set
+# CONFIG_SCSI_AIC7XXX is not set
+# CONFIG_SCSI_AIC7XXX_OLD is not set
+# CONFIG_SCSI_DPT_I2O is not set
+# CONFIG_SCSI_ADVANSYS is not set
+# CONFIG_SCSI_IN2000 is not set
+# CONFIG_SCSI_AM53C974 is not set
+# CONFIG_SCSI_MEGARAID is not set
+# CONFIG_SCSI_BUSLOGIC is not set
+# CONFIG_SCSI_CPQFCTS is not set
+# CONFIG_SCSI_DMX3191D is not set
+# CONFIG_SCSI_DTC3280 is not set
+# CONFIG_SCSI_EATA is not set
+# CONFIG_SCSI_EATA_DMA is not set
+# CONFIG_SCSI_EATA_PIO is not set
+# CONFIG_SCSI_FUTURE_DOMAIN is not set
+# CONFIG_SCSI_GDTH is not set
+# CONFIG_SCSI_GENERIC_NCR5380 is not set
+# CONFIG_SCSI_IPS is not set
+# CONFIG_SCSI_INITIO is not set
+# CONFIG_SCSI_INIA100 is not set
+# CONFIG_SCSI_PPA is not set
+# CONFIG_SCSI_IMM is not set
+# CONFIG_SCSI_NCR53C406A is not set
+# CONFIG_SCSI_NCR53C7xx is not set
+# CONFIG_SCSI_SYM53C8XX_2 is not set
+# CONFIG_SCSI_NCR53C8XX is not set
+CONFIG_SCSI_SYM53C8XX=m
+CONFIG_SCSI_NCR53C8XX_DEFAULT_TAGS=4
+CONFIG_SCSI_NCR53C8XX_MAX_TAGS=32
+CONFIG_SCSI_NCR53C8XX_SYNC=20
+# CONFIG_SCSI_NCR53C8XX_PROFILE is not set
+# CONFIG_SCSI_NCR53C8XX_IOMAPPED is not set
+# CONFIG_SCSI_NCR53C8XX_PQS_PDS is not set
+# CONFIG_SCSI_NCR53C8XX_SYMBIOS_COMPAT is not set
+# CONFIG_SCSI_PAS16 is not set
+# CONFIG_SCSI_PCI2000 is not set
+# CONFIG_SCSI_PCI2220I is not set
+# CONFIG_SCSI_PSI240I is not set
+# CONFIG_SCSI_QLOGIC_FAS is not set
+# CONFIG_SCSI_QLOGIC_ISP is not set
+# CONFIG_SCSI_QLOGIC_FC is not set
+# CONFIG_SCSI_QLOGIC_1280 is not set
+# CONFIG_SCSI_SEAGATE is not set
+# CONFIG_SCSI_SIM710 is not set
+# CONFIG_SCSI_SYM53C416 is not set
+# CONFIG_SCSI_DC390T is not set
+# CONFIG_SCSI_T128 is not set
+# CONFIG_SCSI_U14_34F is not set
+# CONFIG_SCSI_ULTRASTOR is not set
+# CONFIG_SCSI_DEBUG is not set
+
+#
+# Fusion MPT device support
+#
+# CONFIG_FUSION is not set
+# CONFIG_FUSION_BOOT is not set
+# CONFIG_FUSION_ISENSE is not set
+# CONFIG_FUSION_CTL is not set
+# CONFIG_FUSION_LAN is not set
+
+#
+# IEEE 1394 (FireWire) support (EXPERIMENTAL)
+#
+# CONFIG_IEEE1394 is not set
+
+#
+# I2O device support
+#
+# CONFIG_I2O is not set
+
+#
+# Network device support
+#
+CONFIG_NETDEVICES=y
+
+#
+# ARCnet devices
+#
+# CONFIG_ARCNET is not set
+# CONFIG_DUMMY is not set
+# CONFIG_BONDING is not set
+# CONFIG_EQUALIZER is not set
+# CONFIG_TUN is not set
+# CONFIG_ETHERTAP is not set
+
+#
+# Ethernet (10 or 100Mbit)
+#
+CONFIG_NET_ETHERNET=y
+# CONFIG_HAPPYMEAL is not set
+# CONFIG_SUNGEM is not set
+# CONFIG_NET_VENDOR_3COM is not set
+# CONFIG_LANCE is not set
+# CONFIG_NET_VENDOR_SMC is not set
+# CONFIG_NET_VENDOR_RACAL is not set
+# CONFIG_AT1700 is not set
+# CONFIG_DEPCA is not set
+# CONFIG_HP100 is not set
+# CONFIG_NET_ISA is not set
+CONFIG_NET_PCI=y
+# CONFIG_PCNET32 is not set
+# CONFIG_ADAPTEC_STARFIRE is not set
+# CONFIG_AC3200 is not set
+# CONFIG_APRICOT is not set
+# CONFIG_CS89x0 is not set
+# CONFIG_TULIP is not set
+# CONFIG_DE4X5 is not set
+# CONFIG_DGRS is not set
+CONFIG_DM9102=y
+# CONFIG_EEPRO100 is not set
+# CONFIG_FEALNX is not set
+# CONFIG_NATSEMI is not set
+# CONFIG_NE2K_PCI is not set
+# CONFIG_8139CP is not set
+# CONFIG_8139TOO is not set
+# CONFIG_SIS900 is not set
+# CONFIG_EPIC100 is not set
+# CONFIG_SUNDANCE is not set
+# CONFIG_TLAN is not set
+# CONFIG_VIA_RHINE is not set
+# CONFIG_WINBOND_840 is not set
+# CONFIG_NET_POCKET is not set
+
+#
+# Ethernet (1000 Mbit)
+#
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_FDDI is not set
+# CONFIG_HIPPI is not set
+# CONFIG_PLIP is not set
+CONFIG_PPP=m
+# CONFIG_PPP_MULTILINK is not set
+CONFIG_PPP_ASYNC=m
+# CONFIG_PPP_SYNC_TTY is not set
+# CONFIG_PPP_DEFLATE is not set
+# CONFIG_PPP_BSDCOMP is not set
+# CONFIG_PPPOE is not set
+# CONFIG_SLIP is not set
+
+#
+# Wireless LAN (non-hamradio)
+#
+# CONFIG_NET_RADIO is not set
+
+#
+# Token Ring devices
+#
+# CONFIG_TR is not set
+# CONFIG_NET_FC is not set
+# CONFIG_RCPCI is not set
+# CONFIG_SHAPER is not set
+
+#
+# Wan interfaces
+#
+# CONFIG_WAN is not set
+
+#
+# Amateur Radio support
+#
+# CONFIG_HAMRADIO is not set
+
+#
+# IrDA (infrared) support
+#
+# CONFIG_IRDA is not set
+
+#
+# ISDN subsystem
+#
+# CONFIG_ISDN is not set
+
+#
+# Old CD-ROM drivers (not SCSI, not IDE)
+#
+# CONFIG_CD_NO_IDESCSI is not set
+
+#
+# Input core support
+#
+CONFIG_INPUT=m
+CONFIG_INPUT_KEYBDEV=m
+CONFIG_INPUT_MOUSEDEV=m
+CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
+CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
+# CONFIG_INPUT_JOYDEV is not set
+# CONFIG_INPUT_EVDEV is not set
+
+#
+# Character devices
+#
+CONFIG_VT=y
+CONFIG_VT_CONSOLE=y
+CONFIG_SERIAL=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_SERIAL_EXTENDED=y
+CONFIG_SERIAL_MANY_PORTS=y
+CONFIG_SERIAL_SHARE_IRQ=y
+# CONFIG_SERIAL_DETECT_IRQ is not set
+# CONFIG_SERIAL_MULTIPORT is not set
+# CONFIG_HUB6 is not set
+# CONFIG_SERIAL_NONSTANDARD is not set
+CONFIG_UNIX98_PTYS=y
+CONFIG_UNIX98_PTY_COUNT=256
+# CONFIG_PRINTER is not set
+# CONFIG_PPDEV is not set
+
+#
+# I2C support
+#
+# CONFIG_I2C is not set
+
+#
+# Mice
+#
+# CONFIG_BUSMOUSE is not set
+CONFIG_MOUSE=y
+CONFIG_PSMOUSE=y
+# CONFIG_82C710_MOUSE is not set
+# CONFIG_PC110_PAD is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_GAMEPORT is not set
+# CONFIG_INPUT_SERIO is not set
+
+#
+# Joysticks
+#
+# CONFIG_INPUT_IFORCE_USB is not set
+# CONFIG_INPUT_DB9 is not set
+# CONFIG_INPUT_GAMECON is not set
+# CONFIG_INPUT_TURBOGRAFX is not set
+# CONFIG_QIC02_TAPE is not set
+
+#
+# Watchdog Cards
+#
+CONFIG_WATCHDOG=y
+# CONFIG_WATCHDOG_NOWAYOUT is not set
+# CONFIG_SOFT_WATCHDOG is not set
+# CONFIG_WDT is not set
+# CONFIG_WDTPCI is not set
+# CONFIG_PCWATCHDOG is not set
+# CONFIG_ACQUIRE_WDT is not set
+# CONFIG_ADVANTECH_WDT is not set
+# CONFIG_EUROTECH_WDT is not set
+# CONFIG_IB700_WDT is not set
+# CONFIG_I810_TCO is not set
+# CONFIG_MIXCOMWD is not set
+# CONFIG_60XX_WDT is not set
+CONFIG_TS486_WDT=y
+# CONFIG_W83877F_WDT is not set
+# CONFIG_MACHZ_WDT is not set
+# CONFIG_INTEL_RNG is not set
+# CONFIG_NVRAM is not set
+# CONFIG_RTC is not set
+# CONFIG_DTLK is not set
+# CONFIG_R3964 is not set
+# CONFIG_APPLICOM is not set
+# CONFIG_SONYPI is not set
+
+#
+# Ftape, the floppy tape device driver
+#
+# CONFIG_FTAPE is not set
+# CONFIG_AGP is not set
+# CONFIG_DRM is not set
+# CONFIG_MWAVE is not set
+CONFIG_TSA2D=m
+
+#
+# Multimedia devices
+#
+CONFIG_VIDEO_DEV=m
+
+#
+# Video For Linux
+#
+CONFIG_VIDEO_PROC_FS=y
+
+#
+# Video Adapters
+#
+# CONFIG_VIDEO_PMS is not set
+# CONFIG_VIDEO_BWQCAM is not set
+# CONFIG_VIDEO_CQCAM is not set
+# CONFIG_VIDEO_CPIA is not set
+# CONFIG_VIDEO_STRADIS is not set
+
+#
+# Radio Adapters
+#
+# CONFIG_RADIO_CADET is not set
+# CONFIG_RADIO_RTRACK is not set
+# CONFIG_RADIO_RTRACK2 is not set
+# CONFIG_RADIO_AZTECH is not set
+# CONFIG_RADIO_GEMTEK is not set
+# CONFIG_RADIO_GEMTEK_PCI is not set
+# CONFIG_RADIO_MAXIRADIO is not set
+# CONFIG_RADIO_MAESTRO is not set
+# CONFIG_RADIO_SF16FMI is not set
+# CONFIG_RADIO_TERRATEC is not set
+# CONFIG_RADIO_TRUST is not set
+# CONFIG_RADIO_TYPHOON is not set
+# CONFIG_RADIO_ZOLTRIX is not set
+
+#
+# File systems
+#
+# CONFIG_QUOTA is not set
+# CONFIG_AUTOFS_FS is not set
+CONFIG_AUTOFS4_FS=y
+CONFIG_REISERFS_FS=m
+# CONFIG_REISERFS_CHECK is not set
+# CONFIG_REISERFS_PROC_INFO is not set
+# CONFIG_ADFS_FS is not set
+# CONFIG_AFFS_FS is not set
+# CONFIG_HFS_FS is not set
+# CONFIG_BFS_FS is not set
+CONFIG_EXT3_FS=y
+CONFIG_JBD=y
+# CONFIG_JBD_DEBUG is not set
+CONFIG_FAT_FS=m
+CONFIG_MSDOS_FS=m
+CONFIG_UMSDOS_FS=m
+# CONFIG_VFAT_FS is not set
+# CONFIG_EFS_FS is not set
+# CONFIG_CRAMFS is not set
+CONFIG_TMPFS=y
+# CONFIG_RAMFS is not set
+CONFIG_ISO9660_FS=m
+# CONFIG_JOLIET is not set
+# CONFIG_ZISOFS is not set
+# CONFIG_MINIX_FS is not set
+# CONFIG_VXFS_FS is not set
+# CONFIG_NTFS_FS is not set
+# CONFIG_HPFS_FS is not set
+CONFIG_PROC_FS=y
+CONFIG_DEVFS_FS=y
+CONFIG_DEVFS_MOUNT=y
+# CONFIG_DEVFS_DEBUG is not set
+CONFIG_DEVPTS_FS=y
+# CONFIG_QNX4FS_FS is not set
+# CONFIG_ROMFS_FS is not set
+CONFIG_EXT2_FS=y
+# CONFIG_SYSV_FS is not set
+# CONFIG_UDF_FS is not set
+# CONFIG_UFS_FS is not set
+
+#
+# Network File Systems
+#
+# CONFIG_CODA_FS is not set
+# CONFIG_INTERMEZZO_FS is not set
+CONFIG_NFS_FS=y
+CONFIG_NFS_V3=y
+CONFIG_ROOT_NFS=y
+CONFIG_NFSD=y
+CONFIG_NFSD_V3=y
+CONFIG_SUNRPC=y
+CONFIG_LOCKD=y
+CONFIG_LOCKD_V4=y
+CONFIG_SMB_FS=m
+# CONFIG_SMB_NLS_DEFAULT is not set
+# CONFIG_NCP_FS is not set
+# CONFIG_ZISOFS_FS is not set
+# CONFIG_ZLIB_FS_INFLATE is not set
+
+#
+# Partition Types
+#
+# CONFIG_PARTITION_ADVANCED is not set
+CONFIG_MSDOS_PARTITION=y
+CONFIG_SMB_NLS=y
+CONFIG_NLS=y
+
+#
+# Native Language Support
+#
+CONFIG_NLS_DEFAULT="iso8859-1"
+# CONFIG_NLS_CODEPAGE_437 is not set
+# CONFIG_NLS_CODEPAGE_737 is not set
+# CONFIG_NLS_CODEPAGE_775 is not set
+# CONFIG_NLS_CODEPAGE_850 is not set
+# CONFIG_NLS_CODEPAGE_852 is not set
+# CONFIG_NLS_CODEPAGE_855 is not set
+# CONFIG_NLS_CODEPAGE_857 is not set
+# CONFIG_NLS_CODEPAGE_860 is not set
+# CONFIG_NLS_CODEPAGE_861 is not set
+# CONFIG_NLS_CODEPAGE_862 is not set
+# CONFIG_NLS_CODEPAGE_863 is not set
+# CONFIG_NLS_CODEPAGE_864 is not set
+# CONFIG_NLS_CODEPAGE_865 is not set
+# CONFIG_NLS_CODEPAGE_866 is not set
+# CONFIG_NLS_CODEPAGE_869 is not set
+# CONFIG_NLS_CODEPAGE_936 is not set
+# CONFIG_NLS_CODEPAGE_950 is not set
+# CONFIG_NLS_CODEPAGE_932 is not set
+# CONFIG_NLS_CODEPAGE_949 is not set
+# CONFIG_NLS_CODEPAGE_874 is not set
+# CONFIG_NLS_ISO8859_8 is not set
+# CONFIG_NLS_CODEPAGE_1250 is not set
+# CONFIG_NLS_CODEPAGE_1251 is not set
+# CONFIG_NLS_ISO8859_1 is not set
+# CONFIG_NLS_ISO8859_2 is not set
+# CONFIG_NLS_ISO8859_3 is not set
+# CONFIG_NLS_ISO8859_4 is not set
+# CONFIG_NLS_ISO8859_5 is not set
+# CONFIG_NLS_ISO8859_6 is not set
+# CONFIG_NLS_ISO8859_7 is not set
+# CONFIG_NLS_ISO8859_9 is not set
+# CONFIG_NLS_ISO8859_13 is not set
+# CONFIG_NLS_ISO8859_14 is not set
+# CONFIG_NLS_ISO8859_15 is not set
+# CONFIG_NLS_KOI8_R is not set
+# CONFIG_NLS_KOI8_U is not set
+# CONFIG_NLS_UTF8 is not set
+
+#
+# Console drivers
+#
+CONFIG_VGA_CONSOLE=y
+# CONFIG_VIDEO_SELECT is not set
+# CONFIG_MDA_CONSOLE is not set
+
+#
+# Frame-buffer support
+#
+# CONFIG_FB is not set
+
+#
+# Sound
+#
+# CONFIG_SOUND is not set
+
+#
+# USB support
+#
+CONFIG_USB=m
+# CONFIG_USB_DEBUG is not set
+
+#
+# Miscellaneous USB options
+#
+CONFIG_USB_DEVICEFS=y
+# CONFIG_USB_BANDWIDTH is not set
+# CONFIG_USB_LONG_TIMEOUT is not set
+
+#
+# USB Controllers
+#
+# CONFIG_USB_UHCI is not set
+# CONFIG_USB_UHCI_ALT is not set
+CONFIG_USB_OHCI=m
+
+#
+# USB Device Class drivers
+#
+CONFIG_USB_BLUETOOTH=m
+CONFIG_USB_STORAGE=m
+# CONFIG_USB_STORAGE_DEBUG is not set
+# CONFIG_USB_STORAGE_DATAFAB is not set
+# CONFIG_USB_STORAGE_FREECOM is not set
+# CONFIG_USB_STORAGE_ISD200 is not set
+# CONFIG_USB_STORAGE_DPCM is not set
+# CONFIG_USB_STORAGE_HP8200e is not set
+CONFIG_USB_STORAGE_SDDR09=y
+# CONFIG_USB_STORAGE_JUMPSHOT is not set
+CONFIG_USB_ACM=m
+CONFIG_USB_PRINTER=m
+
+#
+# USB Human Interface Devices (HID)
+#
+CONFIG_USB_HID=m
+# CONFIG_USB_HIDDEV is not set
+CONFIG_USB_KBD=m
+CONFIG_USB_MOUSE=m
+# CONFIG_USB_WACOM is not set
+
+#
+# USB Imaging devices
+#
+CONFIG_USB_DC2XX=m
+# CONFIG_USB_MDC800 is not set
+CONFIG_USB_SCANNER=m
+CONFIG_USB_MICROTEK=m
+CONFIG_USB_HPUSBSCSI=m
+
+#
+# USB Multimedia devices
+#
+CONFIG_USB_IBMCAM=m
+CONFIG_USB_OV511=m
+CONFIG_USB_PWC=m
+CONFIG_USB_SE401=m
+CONFIG_USB_STV680=m
+CONFIG_USB_VICAM=m
+CONFIG_USB_DSBR=m
+CONFIG_USB_DABUSB=m
+
+#
+# USB Network adaptors
+#
+# CONFIG_USB_PEGASUS is not set
+# CONFIG_USB_KAWETH is not set
+# CONFIG_USB_CATC is not set
+# CONFIG_USB_CDCETHER is not set
+# CONFIG_USB_USBNET is not set
+
+#
+# USB port drivers
+#
+# CONFIG_USB_USS720 is not set
+
+#
+# USB Serial Converter support
+#
+CONFIG_USB_SERIAL=m
+CONFIG_USB_SERIAL_GENERIC=y
+# CONFIG_USB_SERIAL_BELKIN is not set
+# CONFIG_USB_SERIAL_WHITEHEAT is not set
+CONFIG_USB_SERIAL_DIGI_ACCELEPORT=m
+# CONFIG_USB_SERIAL_EMPEG is not set
+# CONFIG_USB_SERIAL_FTDI_SIO is not set
+CONFIG_USB_SERIAL_VISOR=m
+CONFIG_USB_SERIAL_IPAQ=m
+# CONFIG_USB_SERIAL_IR is not set
+# CONFIG_USB_SERIAL_EDGEPORT is not set
+# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
+# CONFIG_USB_SERIAL_KEYSPAN is not set
+# CONFIG_USB_SERIAL_MCT_U232 is not set
+# CONFIG_USB_SERIAL_KLSI is not set
+# CONFIG_USB_SERIAL_PL2303 is not set
+# CONFIG_USB_SERIAL_CYBERJACK is not set
+# CONFIG_USB_SERIAL_XIRCOM is not set
+# CONFIG_USB_SERIAL_OMNINET is not set
+
+#
+# USB Miscellaneous drivers
+#
+# CONFIG_USB_RIO500 is not set
+
+#
+# Bluetooth support
+#
+# CONFIG_BLUEZ is not set
+
+#
+# Kernel hacking
+#
+# CONFIG_DEBUG_KERNEL is not set
Index: Documentation/Configure.help
diff -u Documentation/Configure.help:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/Documentation/Configure.help:1.1.1.1.2.3
--- Documentation/Configure.help:1.1.1.1	Mon Dec 16 03:16:54 2002
+++ Documentation/Configure.help	Mon May 12 07:07:22 2003
@@ -1402,6 +1402,10 @@
   say M here and read <file:Documentation/modules.txt>.  The module
   will be called DAC960.o.
 
+M-Systems DiskOnChip 2000 Support
+CONFIG_BLK_DEV_MSYS_DOC
+  This driver adds support for the M-Systems DiskOnChip Flash devices.
+
 Parallel port IDE device support
 CONFIG_PARIDE
   There are many external CD-ROM and disk devices that connect through
@@ -3867,6 +3871,8 @@
    - "Winchip-2" for IDT Winchip 2.
    - "Winchip-2A" for IDT Winchips with 3dNow! capabilities.
    - "CyrixIII" for VIA Cyrix III or VIA C3.
+   - "TS-386Ex" for Technologic Systems Intel 386EX based SBCs.
+   - "TS-ElanSC520" for Technologic Systems AMD ELANSC520 based SBCs.
 
   If you don't know what to do, choose "386".
 
@@ -17602,7 +17608,17 @@
   inserted in and removed from the running kernel whenever you want).
   The module is called shwdt.o. If you want to compile it as a module,
   say M here and read Documentation/modules.txt.
-	      
+ 
+Technologic Systems SBC support
+CONFIG_TSYSTEMS
+  This tailors the kernel to support the Technologic Systems Single Board
+  Computers. If your SBC is a 3x00 series board, then choose a processor 
+  type of i386. 
+  If your board is a 5x00 series board, then choose the processor type
+  of i486
+
+  More information can be found at www.embeddedx86.com
+  
 Toshiba Laptop support
 CONFIG_TOSHIBA
   This adds a driver to safely access the System Management Mode of
Index: arch/i386/config.in
diff -u arch/i386/config.in:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/arch/i386/config.in:1.1.1.1.2.3
--- arch/i386/config.in:1.1.1.1	Mon Dec 16 03:16:04 2002
+++ arch/i386/config.in	Wed Apr 23 09:43:55 2003
@@ -46,7 +46,6 @@
 #
 # Define implied options from the CPU selection here
 #
-
 if [ "$CONFIG_M386" = "y" ]; then
    define_bool CONFIG_X86_CMPXCHG n
    define_bool CONFIG_X86_XADD n
@@ -163,6 +162,22 @@
    define_bool CONFIG_X86_USE_PPRO_CHECKSUM y
    define_bool CONFIG_X86_OOSTORE y
 fi
+
+bool 'Technologic Systems SBC support' TSYSTEMS
+
+if [ "$CONFIG_M386" = "y" ]; then
+  if [ "$TSYSTEMS" = "y" ]; then
+	define_bool CONFIG_TS_M386 y
+  fi
+fi
+
+if [ "$CONFIG_M486" = "y" ]; then
+  if [ "$TSYSTEMS" = "y" ]; then 
+	define_bool CONFIG_TS_M486 y
+  fi
+fi
+	
+
 tristate 'Toshiba Laptop support' CONFIG_TOSHIBA
 tristate 'Dell laptop support' CONFIG_I8K
 
Index: arch/i386/defconfig
diff -u arch/i386/defconfig:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/arch/i386/defconfig:1.1.1.1.2.1
--- arch/i386/defconfig:1.1.1.1	Mon Dec 16 03:16:04 2002
+++ arch/i386/defconfig	Wed Apr 23 09:36:16 2003
@@ -49,6 +49,7 @@
 CONFIG_X86_GOOD_APIC=y
 CONFIG_X86_PGE=y
 CONFIG_X86_USE_PPRO_CHECKSUM=y
+# TSYSTEMS is not set
 # CONFIG_TOSHIBA is not set
 # CONFIG_I8K is not set
 # CONFIG_MICROCODE is not set
Index: arch/i386/kernel/process.c
diff -u arch/i386/kernel/process.c:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/arch/i386/kernel/process.c:1.1.1.1.2.1
--- arch/i386/kernel/process.c:1.1.1.1	Mon Dec 16 03:16:04 2002
+++ arch/i386/kernel/process.c	Mon Dec 16 04:21:10 2002
@@ -280,6 +280,16 @@
 {
 	unsigned long flags;
 
+#ifdef CONFIG_TS_M386
+//	20010219 mtj this enables the watchdog on the intel 386EX, the watchdog
+//	output is tied to the PLD and causes the system reset line to assert.
+	outw( 0x0000, 0xF4C0 );
+	outw( 0x0020, 0xF4C2 );
+	outw( 0xF01E, 0xF4C8 );
+	outw( 0x0FE1, 0xF4C8 );
+#endif
+
+
 	cli();
 
 	/* Write zero to CMOS register number 0x0f, which the BIOS POST
Index: drivers/block/Config.in
diff -u drivers/block/Config.in:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/block/Config.in:1.1.1.1.2.1
--- drivers/block/Config.in:1.1.1.1	Mon Dec 16 03:14:55 2002
+++ drivers/block/Config.in	Mon May 12 07:07:23 2003
@@ -46,4 +46,6 @@
 fi
 dep_bool '  Initial RAM disk (initrd) support' CONFIG_BLK_DEV_INITRD $CONFIG_BLK_DEV_RAM
 
+dep_tristate 'M-Systems DOC device support' CONFIG_BLK_DEV_MSYS_DOC m
+
 endmenu
Index: drivers/block/Makefile
diff -u drivers/block/Makefile:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/block/Makefile:1.1.1.1.2.1
--- drivers/block/Makefile:1.1.1.1	Mon Dec 16 03:14:55 2002
+++ drivers/block/Makefile	Mon May 12 07:07:23 2003
@@ -34,4 +34,7 @@
 
 subdir-$(CONFIG_PARIDE) += paride
 
+obj-$(CONFIG_BLK_DEV_MSYS_DOC) += doc/doc.o
+subdir-$(CONFIG_BLK_DEV_MSYS_DOC) += doc
+
 include $(TOPDIR)/Rules.make
Index: drivers/block/ll_rw_blk.c
diff -u drivers/block/ll_rw_blk.c:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/block/ll_rw_blk.c:1.1.1.1.2.1
--- drivers/block/ll_rw_blk.c:1.1.1.1	Mon Dec 16 03:14:54 2002
+++ drivers/block/ll_rw_blk.c	Mon May 12 07:07:23 2003
@@ -1154,6 +1154,9 @@
 #ifdef CONFIG_BLK_DEV_MFM
 	mfm_init();
 #endif
+#ifdef CONFIG_BLK_DEV_MSYS_DOC
+	fl_init();
+#endif /* CONFIG_BLK_DEV_MSYS_DOC */
 #ifdef CONFIG_PARIDE
 	{ extern void paride_init(void); paride_init(); };
 #endif
Index: drivers/block/doc/Makefile
diff -u /dev/null drivers/block/doc/Makefile:1.1.2.1
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/block/doc/Makefile	Mon May 12 08:06:12 2003
@@ -0,0 +1,19 @@
+# Makefile for a block device driver
+# for the DiskOnChip flash module from M-Systems
+
+ifndef TOPDIR
+TOPDIR = ../../../
+endif
+
+O_TARGET := doc.o
+list-multi      := doc.o
+obj-$(CONFIG_BLK_DEV_MSYS_DOC) += doc.o
+doc-objs   := fldrvlnx.o libosak
+
+include $(TOPDIR)/Rules.make
+
+doc.o: $(doc-objs)
+	   $(LD) -r -o $@ $(doc-objs)
+	
+fldrvlnx.c: fldrvlnx.h
+
Index: drivers/block/doc/fldrvlnx.c
diff -u /dev/null drivers/block/doc/fldrvlnx.c:1.1.2.1
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/block/doc/fldrvlnx.c	Mon May 12 07:07:23 2003
@@ -0,0 +1,1948 @@
+/*
+ * $Log: fldrvlnx.c,v $
+ * Revision 1.1.2.1  2003/05/12 14:07:23  grimiore
+ *
+ * m-system's DiskOnChip kernel hacks. Adds in TrueFFS v 5.1.4 binary-only driver
+ *
+ * 
+ */
+
+/***********************************************************************************/
+/*                        M-Systems Confidential                                   */
+/*           Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2002            */
+/*                         All Rights Reserved                                     */
+/***********************************************************************************/
+/*                            NOTICE OF M-SYSTEMS OEM                              */
+/*                           SOFTWARE LICENSE AGREEMENT                            */
+/*                                                                                 */
+/*      THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE                 */
+/*      AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT           */
+/*      FOR THE SPECIFIC TERMS AND CONDITIONS OF USE,                              */
+/*      OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE:                               */
+/*      E-MAIL = info@m-sys.com                                                    */
+/***********************************************************************************/
+
+/* get the kernel version */
+#include <linux/version.h>
+/* older kernels didn't define this */
+#ifndef KERNEL_VERSION
+	#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+#endif
+
+/* not supported kernels */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
+#	error "Linux Kernel Version 2.5.0 and later not supported"
+#else
+#	if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+#	else
+#		if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+#			error "Linux Kernel Version 2.3.0 not supported"
+#		else
+#			if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
+#			else
+#				if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+#					error "Linux Kernel Version 2.1.0 not supported"
+#				else
+#					if LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)
+#					else
+#						error "Linux Kernel Version less that 2.0.0 not supported"
+#					endif
+#				endif
+#			endif
+#		endif
+#	endif
+#endif
+
+#ifndef MODVERSIONS
+#	define MODVERSIONS
+#	include <linux/modversions.h>
+#endif
+#include <linux/module.h>			/* must be included after <linux/modversions.h> */
+
+short GetFlDebugParam(void);
+#define DebugPrintk(fmt,args...)		if(GetFlDebugParam()){printk(KERN_DEBUG"fl: "fmt,## args);}
+
+#include "fldrvlnx.h"
+
+#include <asm/io.h>				/* isa_write...() */
+#include <linux/ioport.h>			/* request_mem_reqion() */
+#include <linux/delay.h>			/* udelay() */
+
+#ifdef DEEPDEBUG
+	#define LOG_DELAY	 flsleep(1)
+#else
+	#define LOG_DELAY
+#endif
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+
+#include <linux/init.h>				/* __initdata */
+#include <linux/sched.h>
+#include <linux/kernel.h>			/* printk() */
+#include <linux/slab.h>				/* kmalloc() */
+#include <linux/vmalloc.h>
+#include <linux/fs.h>				/* everything... */
+#include <linux/errno.h>			/* error codes */
+#include <linux/timer.h>
+#include <linux/fcntl.h>			/* O_ACCMODE */
+#include <linux/hdreg.h>			/* HDIO_GETGEO */
+#include <linux/devfs_fs_kernel.h>	/* devfs_handle_t */
+#include <linux/smp_lock.h>			/* lock_kernel() */
+#include <linux/proc_fs.h>			/* create_proc_read_entry() */
+#include <asm/system.h>				/* cli(), *_flags */
+#include <asm/uaccess.h>			/* verify_area() */
+
+#define grab_io_request_lock(flags) spin_lock_irqsave(&io_request_lock,flags)
+#define rlse_io_request_lock(flags) spin_unlock_irqrestore(&io_request_lock,flags)
+static devfs_handle_t devfs_handle = NULL;
+
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
+
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/kernel.h>
+#include <linux/malloc.h>
+#include <linux/vmalloc.h>
+#include <linux/fs.h>
+#include <linux/errno.h>
+#include <linux/timer.h>
+#include <linux/types.h>
+#include <linux/fcntl.h>
+#include <linux/hdreg.h>
+#include <linux/proc_fs.h>
+#include <linux/string.h>
+#include <linux/ioctl.h>
+#include <linux/genhd.h>
+#include <linux/hdreg.h>
+#include <linux/sockios.h>
+#include <linux/smp_lock.h>
+
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/segment.h>
+#include <asm/uaccess.h>
+
+extern spinlock_t io_request_lock;
+#define grab_io_request_lock(flags) spin_lock_irqsave(&io_request_lock,flags)
+#define rlse_io_request_lock(flags) spin_unlock_irqrestore(&io_request_lock,flags)
+
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)
+
+#include <linux/kernel.h>
+#include <linux/string.h>
+#include <linux/ioctl.h>
+#include <linux/genhd.h>
+#include <linux/malloc.h>			/* kmalloc() */
+#include <linux/hdreg.h>			/* struct hd_geometry */
+#include <linux/proc_fs.h>
+#include <asm/system.h>
+#include <asm/segment.h>
+//extern unsigned long loops_per_sec; /* needed by macro udelay() */
+
+//#include <asm/delay.h>				/* macro udelay() */
+#include <asm/io.h>					/* memcpy_*io() */
+#ifndef __KERNEL_SYSCALLS__
+/* need this to get declaration of kernel_thread() */
+#define __KERNEL_SYSCALLS__
+#endif
+#include <linux/unistd.h>			/* kernel_thread() */
+#include <linux/sched.h>			/* jiffies */
+
+typedef struct spinlock
+{
+	int lock;
+}spinlock_t;
+
+#define test_and_set_bit(bnr,lp)			set_bit(bnr,lp)
+#define test_and_clear_bit(bnr,lp)			clear_bit(bnr,lp)
+#define set_current_state(state_value)		do {current->state = state_value; } while (0)
+#define grab_io_request_lock(flags) do { save_flags(flags); cli(); } while (0)
+	/* spin_lock_irqsave(&io_request_lock,*(flgptr)) */
+#define rlse_io_request_lock(flags) do { restore_flags(flags); } while (0)
+	/* spin_unlock_irqsave(&io_request_lock,*(flgptr)) */
+#define lock_kernel()	/* ToDo */
+#define unlock_kernel()	/* ToDo */
+#define sigmask(signum) (1UL << ((signum) - 1))
+
+/* Kernel threads. */
+#define exit_fs(foo)
+#define exit_files(foo)
+
+static void siginitsetinv(sigset_t *set, unsigned long mask);
+static void sigemptyset(sigset_t *set);
+static inline unsigned long copy_to_user(void *to,const void *from, unsigned long n);
+static void spin_lock_init(spinlock_t *splp);
+static void spin_lock(spinlock_t *splp);
+static void spin_unlock(spinlock_t *splp);
+static inline unsigned long copy_to_user(void *to,const void *from, unsigned long n);
+
+#endif
+
+/* definitions for blk.h */
+
+#include <linux/major.h>
+int flMajor;	/* our major device number */
+#define MAJOR_NR flMajor
+#define DEVICE_NAME "fl"
+#define DEVICE_OFF(d)
+#define DEVICE_REQUEST fl_request_fn1
+#define DEVICE_NR(device) (MINOR(device)>>FL_SHIFT)
+#define DEVICE_NO_RANDOM
+#include <linux/blk.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
+#include <linux/blkpg.h>
+#endif
+
+/* defines after blk.h - need struct request from blkdev.h */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
+static int end_that_request_first(struct request *req,int uptodate,char *devname);
+static void end_that_request_last(struct request *req);
+#endif
+
+/* end of blk.h definitions */
+
+/* private includes for M-Systems OSAK */
+#include "tffs2lnx.h"
+
+/* module parameters */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+MODULE_AUTHOR("yurid@msys.com");
+
+MODULE_PARM(major, "i");		/* set to zero to get dynamic major */
+MODULE_PARM_DESC(major, "Major device number to use.");
+
+MODULE_PARM(rahead, "i");
+MODULE_PARM_DESC(rahead, "Set readahead flag for driver.");
+
+MODULE_PARM(hardsect, "1-4i");	/* NB this should be the same as MAX_DEVICES */
+MODULE_PARM_DESC(hardsect, "Set hardsect parameter for each DOC device.");
+
+MODULE_PARM(blksize, "1-4i");	/* NB this should be the same as MAX_DEVICES */
+MODULE_PARM_DESC(blksize, "Set blksize parameter for each DOC device.");
+
+MODULE_PARM(prio,"i");
+
+MODULE_PARM(fl_debug,"h");
+MODULE_PARM(fl_winl,"l");
+MODULE_PARM(fl_winh,"l");
+MODULE_PARM(fl_part_prot,"h");
+MODULE_PARM(fl_key_prot,"s");
+
+MODULE_PARM(fl_nftl_cache,"h");
+MODULE_PARM(fl_is_ram_check,"h");
+MODULE_PARM(fl_8bit_access,"h");
+MODULE_PARM(fl_mtd_bus_access_type,"l");
+MODULE_PARM(fl_verify_write_bdtl,"l");
+MODULE_PARM(fl_verify_write_binary,"l");
+MODULE_PARM(fl_verify_write_other,"l");
+MODULE_PARM(fl_sectors_verified_per_folding,"l");
+
+#else
+#warning No parameters yet.
+#endif
+
+/* these are used only during module initialization */
+#ifndef __initdata
+#	define __initdata
+#endif
+
+static int __initdata major = FLASH_MAJOR;
+static int __initdata rahead = 0;
+static int __initdata hardsect[MAX_DEVICES];
+static int __initdata blksize[MAX_DEVICES];
+#ifdef DEEPDEBUG
+static short __initdata			fl_debug=1;
+#else
+static short __initdata			fl_debug=0;
+#endif
+static unsigned long __initdata		fl_winl=FL_DOC_PHYS_ADDR_LOW;
+static unsigned long __initdata		fl_winh=FL_DOC_PHYS_ADDR_HIGH;
+static void * __initdata		fl_virl=NULL;
+static void * __initdata		fl_virh=NULL;
+static short __initdata			fl_part_prot=MAX_DEVICES;
+static char * __initdata		fl_key_prot=NULL;
+static short __initdata			fl_nftl_cache=1;
+static short __initdata			fl_is_ram_check=0;
+static short __initdata			fl_8bit_access=1;
+static unsigned long __initdata		fl_mtd_bus_access_type=7;	/* FL_BUS_HAS_8BIT_ACCESS|FL_BUS_HAS_16BIT_ACCESS|FL_BUS_HAS_32BIT_ACCESS|FL_NO_ADDR_SHIFT) */
+static unsigned long __initdata		fl_verify_write_bdtl=0;
+static unsigned long __initdata		fl_verify_write_binary=0;
+static unsigned long __initdata		fl_verify_write_other=0;
+static unsigned long __initdata		fl_sectors_verified_per_folding=64;
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+static int __initdata prio=-10;	/* max -20 */
+#else
+static int __initdata prio=30;		/* max 40 */
+#endif
+
+#define FL_SHIFT		6
+#define MINOR_NR(r)		(r<<FL_SHIFT)
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+static DECLARE_MUTEX_LOCKED(start_stop_sem);
+#else
+static struct semaphore start_stop_sem = MUTEX_LOCKED;
+#endif
+
+#define SHUTDOWN_SIGS   (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGQUIT))
+
+static void fl_setsid(void)
+{
+	/* Simple setsid, used at start of kernel thread,
+	   no error checks needed, or at least none made :). */
+	current->leader = 1;
+	current->session = current->pgrp = current->pid;
+	current->tty = NULL;
+	current->tty_old_pgrp = 0;
+}
+
+static spinlock_t o_c_lock;
+
+// private structure for driver
+typedef struct Fl_Dev
+{
+	int             volume;     // DOC volume number
+	int             size;       // DOC volume size in XXX kb
+	int             usage;
+	int             heads;
+	int             sectors;
+	int             cylinders;
+	int             read_only;
+	unsigned int    requests;
+	unsigned int    requests_Read;
+	unsigned int    requests_Write;
+
+	// Every once in a while the DOC wants to "think" for a while.  We
+	// can't sleep while this is happening if we are in the ordinary
+	// request fn context.  What we do instead is use the reqest fn to
+	// move the requests to a private, per device list, and schedule
+	// a kernel task (capable of sleeping when required) to complete
+	// the requests.
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	struct list_head queue_head;  // private list for I/O requests 
+#else
+	struct request *queue;  // Older kernels used singly linked list
+	struct request *revq;   // reversed list, used to simplify transfer
+#endif
+	struct semaphore *sem;
+	int terminating;
+}FL_DEV;
+
+// Start of structures dynamically allocated with kmalloc() during init and
+// (if a module) de-allocated with kfree() if unloaded.
+
+// per DEVICE structures
+static FL_DEV*Fl_devices;         // this is an array FL_Flash_Devices in length
+
+// per DEVICE*MINOR structures
+static int*Fl_blksize_size;    // used in global blksize_size array
+static int*Fl_hardsect_size;   // used in global hardsect_size array
+static int*Fl_blk_size;        // used in gendisk structure and global blk_size array
+
+static struct hd_struct *Fl_partitions;
+
+// End of dynamically allocated structures.
+
+// function declarations
+
+int             fl_open(struct inode *inode, struct file *filp);
+int             fl_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg);
+int             fl_check_change(kdev_t i_rdev);
+int             fl_revalidate(kdev_t i_rdev);
+int             fl_init(void);
+static void     fl_geninit(struct gendisk *);
+
+// copies flioctl_t data into kernel
+/* static char *	fl_usr2kern(unsigned long); */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+int             fl_release(struct inode *inode, struct file *filp);
+#else // > 2.1.0
+void            fl_release(struct inode *inode, struct file *filp);
+#endif // > 2.1.0
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+void            fl_request_fn1(request_queue_t *q);
+#else
+void            fl_request_fn1(void);
+#endif // < 2.4.0
+
+// driver globals
+int             flMajor;           // our major device number
+int             Fl_read_ahead;      // used in global read_ahead array 
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+
+static struct block_device_operations fl_fops =
+{
+	open: fl_open,                   // open
+	release: fl_release,             // release 
+	ioctl: fl_ioctl,                 // ioctl 
+};
+
+static struct gendisk fl_gendisk =
+{
+	0,                         // major        Major number, assigned at runtime 
+	DEVICE_NAME,               // major_name   Major name 
+	FL_SHIFT,                  // minor_shift  Bits to shift to get real from partition 
+	MINOR_NR(1),               // max_p        Number of partitions per real 
+	NULL,                      // hd struct
+	NULL,                      // block sizes
+	0,                         // nr_real      maximum number of real, assigned at runtime 
+	NULL,                      // internal
+	NULL,                      // next         linked list (not used for modules) 
+	&fl_fops,
+	NULL,
+	NULL
+};
+
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+
+static struct file_operations fl_fops =
+{
+	NULL,                      // lseek - default
+	block_read,                // read - block dev read 
+	block_write,               // write - block dev write 
+	NULL,                      // readdir - not here! 
+	NULL,                      // select 
+	fl_ioctl,                  // ioctl 
+	NULL,                      // mmap 
+	fl_open,                   // open
+	NULL,                      // flush 
+	fl_release,                // release 
+	block_fsync,               // fsync 
+	NULL,                      // media change 
+	fl_revalidate,             // revalidate 
+	NULL
+};
+
+static struct gendisk fl_gendisk =
+{
+	0,                         // major        Major number, assigned at runtime 
+	DEVICE_NAME,               // major_name   Major name 
+	FL_SHIFT,                  // minor_shift  Bits to shift to get real from partition 
+	MINOR_NR(1),               // max_p        Number of partitions per real 
+	0,                         // max_nr       maximum number of real, assigned at runtime 
+	fl_geninit,                // init         init function 
+	NULL,                      // part         hd struct (partition table), assigned at runtime 
+	NULL,                      // sizes        block sizes, assigned at runtime 
+	0,                         // nr_real      number, assigned at runtime 
+	NULL,                      // real_devices internal use
+	NULL                       // next         linked list (not used for modules) 
+};
+
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)
+
+static struct file_operations fl_fops =
+{
+	NULL,                      // lseek - default
+	block_read,                // read - block dev read 
+	block_write,               // write - block dev write 
+	NULL,                      // readdir - not here! 
+	NULL,                      // select 
+	fl_ioctl,                  // ioctl 
+	NULL,                      // mmap 
+	fl_open,                   // open
+	fl_release,                // release 
+	block_fsync,               // fsync 
+	NULL,                      // media change 
+	fl_revalidate              // revalidate 
+};
+
+static struct gendisk fl_gendisk =
+{
+	0,                         // major        Major number, assigned at runtime 
+	DEVICE_NAME,               // major_name   Major name 
+	FL_SHIFT,                  // minor_shift  Bits to shift to get real from partition 
+	MINOR_NR(1),               // max_p        Number of partitions per real 
+	0,                         // max_nr       maximum number of real, assigned at runtime 
+	fl_geninit,                // init         init function 
+	NULL,                      // part         hd struct (partition table), assigned at runtime 
+	NULL,                      // sizes        block sizes, assigned at runtime 
+	0,                         // nr_real      number, assigned at runtime 
+	NULL,                      // real_devices internal use
+	NULL                       // next         linked list (not used for modules) 
+};
+
+#else
+#error "OS Not supported"
+#endif 
+
+/* __init ckmalloc()
+ *
+ * kmalloc and clear, only used during init
+ */
+#if defined(__init)
+void * __init ckmalloc(int size, int mode)
+#elif defined(__initfunc)
+__initfunc( void * ckmalloc(int size, int mode))
+#else
+void * ckmalloc(int size, int mode)
+#endif
+{
+	void *ptr;
+	if ((ptr = kmalloc(size, mode)))
+		memset(ptr, 0, size);
+	return(ptr);
+}
+
+/* IFF !NULL free and set to NULL */
+void lkfree(void **ptr)
+{
+	if(*ptr)
+	{
+		kfree(*ptr);
+		*ptr = NULL;
+	}
+}
+
+int fl_open(struct inode *inode, struct file *filp)
+{
+	FL_DEV*dev;	/* device information */
+	int dev_nr;
+
+	/* get the real device number */
+	/* (device&0xff)>>6) */
+	dev_nr = DEVICE_NR(inode->i_rdev);
+
+	if (dev_nr >= fl_gendisk.nr_real)
+	{
+		return -ENODEV;
+	}
+
+	if(FlGetProtection(dev_nr))
+	{
+		if (filp->f_mode & 0x02)
+		{
+			return -EROFS;
+		}
+	}
+
+	/* get pointer to device structure and increment use count */
+	dev = Fl_devices + dev_nr;
+
+	spin_lock(&o_c_lock);
+	dev->usage++;
+	MOD_INC_USE_COUNT;
+	spin_unlock(&o_c_lock);
+	return 0;					/* success */
+}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+int
+#else
+void
+#endif
+fl_release(struct inode *inode, struct file *filp)
+{
+	FL_DEV         *dev;        // device information 
+	int             dev_nr;
+
+	// get the real device number
+	dev_nr = DEVICE_NR(inode->i_rdev);
+
+	if (dev_nr >= fl_gendisk.nr_real)
+	{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+		return -ENODEV;
+#else
+		return;
+#endif
+	}
+
+	dev = Fl_devices + dev_nr;
+
+	// lock and dec usage count
+	spin_lock(&o_c_lock);
+	dev->usage--;
+	// if there are no more open we want to ensure that we flush all blocks.
+	// sync_dev can cause sleep, so this should be _before_ MOD_DEC_USE_COUNT.
+	if (!dev->usage)
+	{
+		// flush it right now
+		sync_dev(inode->i_rdev);
+		invalidate_buffers(inode->i_rdev);
+	}
+	MOD_DEC_USE_COUNT;
+	spin_unlock(&o_c_lock);
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+	return (0);
+#endif
+}
+
+/* Derived from OSAK dosformt.c getDriveGeometry() */
+static void get_drive_geo(long capacity, struct hd_geometry *geo)
+{
+    unsigned long temp;
+
+    geo->heads = 16;                              /* Max out number of heads             */
+    geo->cylinders=1024;
+    temp = geo->cylinders * geo->heads;            /* Compute divisor for heads           */
+    geo->sectors = capacity / temp;                /* Compute value for sectors per track */
+    while (geo->sectors > 0x3f ){                  /* While number of sectors too big     */
+      geo->heads *= 2;                             /* use one more head                   */
+      temp = geo->cylinders * geo->heads;          /* Recompute divisor for heads         */
+      geo->sectors = capacity / temp;              /* Recompute sectors per track         */
+    }
+    if (capacity % temp) {                     /* If no remainder, done!              */
+      geo->sectors++;                            /* Else, increment number of sectors   */
+      temp = geo->cylinders * geo->sectors;        /* Compute divisor for heads           */
+      geo->heads = capacity / temp;                /* Compute value for heads             */
+      if (capacity % temp) {                   /* If no remainder, done!              */
+	geo->heads++;                            /* Else, increment number of heads     */
+        temp = geo->heads * geo->sectors;          /* Compute divisor for cylinders       */
+        geo->cylinders = (unsigned long)(capacity / temp); /* Compute number of cylinders         */
+      }
+    }
+/*
+	geo->heads = 16;
+	geo->cylinders = 1024;
+	temp = geo->cylinders * geo->heads;
+	geo->sectors = capacity / temp;
+
+	if (capacity % temp)
+	{
+		geo->sectors++;
+		temp = geo->cylinders * geo->sectors;
+		geo->heads = capacity / temp;
+		if (capacity % temp)
+		{
+			geo->heads++;
+			temp = geo->heads * geo->sectors;
+			geo->cylinders = capacity / temp;
+		}
+	}
+*/
+}
+
+/* The ioctl() implementation */
+int fl_ioctl(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg)
+{
+	int size;
+	unsigned int dev_nr;
+	FL_DEV*device;
+	int res;
+
+	dev_nr = DEVICE_NR(inode->i_rdev);
+	device = Fl_devices + dev_nr;
+
+	/* verify we have sysadmin capabilities for certain ioctl calls */
+	switch (cmd)
+	{
+	case FL_IOCTL_GET_INFO:
+	case FL_IOCTL_DEFRAGMENT:
+	case FL_IOCTL_WRITE_PROTECT:
+	case FL_IOCTL_MOUNT_VOLUME:
+	case FL_IOCTL_FORMAT_VOLUME:
+	case FL_IOCTL_BDK_OPERATION:
+	case FL_IOCTL_DELETE_SECTORS:
+	case FL_IOCTL_READ_SECTORS:
+	case FL_IOCTL_WRITE_SECTORS:
+	case FL_IOCTL_FORMAT_PHYSICAL_DRIVE:
+	case FL_IOCTL_FORMAT_LOGICAL_DRIVE:
+	case FL_IOCTL_BDTL_HW_PROTECTION:
+	case FL_IOCTL_BINARY_HW_PROTECTION:
+	case FL_IOCTL_OTP:
+	case FL_IOCTL_CUSTOMER_ID:
+	case FL_IOCTL_UNIQUE_ID:
+	case FL_IOCTL_NUMBER_OF_PARTITIONS:
+	case FL_IOCTL_INQUIRE_CAPABILITIES:
+	case FL_IOCTL_SET_ENVIRONMENT_VARIABLES:
+	case FL_IOCTL_PLACE_EXB_BY_BUFFER:
+	case FL_IOCTL_WRITE_IPL:
+	case FL_IOCTL_DEEP_POWER_DOWN_MODE:
+	case FL_IOCTL_EXTENDED_ENVIRONMENT_VARIABLES:
+	case FL_IOCTL_VERIFY_VOLUME:
+	case FL_IOCTL_SET_ACCESS_ROUTINE:
+	case FL_IOCTL_GET_ACCESS_ROUTINE:
+	case FL_IOCTL_EXTENDED_WRITE_IPL:
+	case FL_IOCTL_LNX:
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+		if (!capable(CAP_SYS_ADMIN))
+		{
+			return -EACCES;
+		}
+#endif
+	}
+	/* ioctl's that don't require libosak access */
+	switch(cmd)
+	{
+	case BLKGETSIZE:
+		// Return the device size, expressed in sectors 
+		if(!arg)
+		{
+			return -EINVAL;		/* NULL pointer: not valid  */
+		}
+		if((res=verify_area(VERIFY_WRITE, (long *) arg, sizeof(long))))
+		{
+			return res;
+		}
+		size = fl_gendisk.part[MINOR(inode->i_rdev)].nr_sects;
+		put_user(size, (long *) arg);
+		return 0;
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+	case BLKRAGET:             // return the readahead value 
+
+		if (!arg)
+			return -EINVAL;
+
+		if ((res = verify_area(VERIFY_WRITE, (long *) arg, sizeof(long))))
+		{
+			return res;
+		}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+	/* QQQ no need for verify area? ask SL */
+		put_user_ret(read_ahead[MAJOR(inode->i_rdev)], (long *) arg, -EFAULT);
+#else
+		put_user(read_ahead[MAJOR(inode->i_rdev)], (long *) arg);
+#endif
+		return 0;
+#endif /* < 2.4.0 */
+
+	case HDIO_GETGEO:
+		{
+			struct hd_geometry *geo = (struct hd_geometry *) arg;
+			struct hd_geometry geometry;
+
+			/* check arg */
+			if (geo == NULL)
+			{
+				return -EINVAL;
+			}
+			if ((res = verify_area(VERIFY_WRITE, geo, sizeof(*geo))))
+			{
+				return res;
+			}
+			size = device->size;
+
+			memset(&geometry,0,sizeof(geometry));
+			get_drive_geo(size, &geometry);
+			geometry.start = fl_gendisk.part[MINOR(inode->i_rdev)].start_sect;
+
+			copy_to_user(geo, &geometry, sizeof(geometry));
+			return 0;
+		}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	// This is a list of "standard" ioctls.
+	// The ones that modify things are protected by a semaphore below.
+	case BLKROSET:
+	case BLKROGET:
+	// case BLKRASET:
+	case BLKRAGET:
+	// case BLKPG:
+		res = blk_ioctl(inode->i_rdev, cmd, arg);
+		return(res);
+	case BLKPG:      // play with partitions
+	case BLKFLSBUF:  // flush
+		// This will call the low-level block I/O functions which lock
+		// libosak access themselves, so we'd better not do it here.
+		res = blk_ioctl(inode->i_rdev, cmd, arg);
+		return(res);
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+
+	case BLKFLSBUF:            // flush 
+		fsync_dev(inode->i_rdev);
+		invalidate_buffers(inode->i_rdev);
+		break;
+
+		// The default RO operations
+		RO_IOCTLS(inode->i_rdev, arg);
+#endif // >= 2.4.0
+
+	case BLKRRPART:            // re-read partition table
+		// This will call the low-level block I/O functions which lock
+		// libosak access themselves, so we'd better not do it here.
+		res = fl_revalidate(inode->i_rdev);
+		return(res);
+	}
+
+	// ioctl's that require libosak access (we are modifying something)
+	res = 0;
+	switch(cmd)
+	{
+	/* private stuff */
+	case FL_IOCTL_GET_INFO:
+	case FL_IOCTL_DEFRAGMENT:
+	case FL_IOCTL_WRITE_PROTECT:
+	case FL_IOCTL_MOUNT_VOLUME:
+	case FL_IOCTL_FORMAT_VOLUME:
+	case FL_IOCTL_BDK_OPERATION:
+	case FL_IOCTL_DELETE_SECTORS:
+	case FL_IOCTL_READ_SECTORS:
+	case FL_IOCTL_WRITE_SECTORS:
+	case FL_IOCTL_FORMAT_PHYSICAL_DRIVE:
+	case FL_IOCTL_FORMAT_LOGICAL_DRIVE:
+	case FL_IOCTL_BDTL_HW_PROTECTION:
+	case FL_IOCTL_BINARY_HW_PROTECTION:
+	case FL_IOCTL_OTP:
+	case FL_IOCTL_CUSTOMER_ID:
+	case FL_IOCTL_UNIQUE_ID:
+	case FL_IOCTL_NUMBER_OF_PARTITIONS:
+	case FL_IOCTL_INQUIRE_CAPABILITIES:
+	case FL_IOCTL_SET_ENVIRONMENT_VARIABLES:
+	case FL_IOCTL_PLACE_EXB_BY_BUFFER:
+	case FL_IOCTL_WRITE_IPL:
+	case FL_IOCTL_DEEP_POWER_DOWN_MODE:
+	case FL_IOCTL_EXTENDED_ENVIRONMENT_VARIABLES:
+	case FL_IOCTL_VERIFY_VOLUME:
+	case FL_IOCTL_SET_ACCESS_ROUTINE:
+	case FL_IOCTL_GET_ACCESS_ROUTINE:
+	case FL_IOCTL_EXTENDED_WRITE_IPL:
+	case FL_IOCTL_LNX:
+		if(!FlIoctl(DEVICE_NR(inode->i_rdev), cmd, arg))
+		{
+			res=-EINVAL;
+		}
+		break;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+
+	case BLKRASET:             // set the readahead value 
+		res = blk_ioctl(inode->i_rdev, cmd, arg);
+	break;
+#else //>= 2.4.0
+
+	case BLKRASET:             // set the readahead value 
+		if (arg > 0xff)
+		{
+			res = -EINVAL;      // limit it 
+			break;
+		}
+		read_ahead[MAJOR(inode->i_rdev)] = arg;
+		break;
+#endif /* >= 2.4.0 */
+	default: // unknown command
+		res = -EINVAL; /* ? ENOSYS ? */
+	}
+	return res;
+}
+
+/* Support for removable devices */
+int fl_check_change(kdev_t i_rdev)
+{
+	// TODO
+	return 0;
+}
+
+int fl_revalidate(kdev_t i_rdev)
+{
+	// first partition, # of partitions 
+	int             part1 = MINOR_NR(DEVICE_NR(i_rdev)) + 1;
+	int             npart = MINOR_NR(1) - 1;
+	int             dev_nr;
+
+	// first clear old partition information 
+	memset(fl_gendisk.sizes + part1, 0, npart * sizeof(int));
+	memset(fl_gendisk.part + part1, 0, npart * sizeof(struct hd_struct));
+
+	// then fill new info 
+	dev_nr = DEVICE_NR(i_rdev);
+	// The partition code eventually wants to read
+	// a block and wait for it.  We'd better not lock out the
+	// low level routine fl_do1_request() or we're hosed.
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	grok_partitions(&fl_gendisk, dev_nr, fl_gendisk.max_p,Fl_devices[dev_nr].size);
+				   /* device->size); */
+#else
+	resetup_one_dev(&fl_gendisk, dev_nr);
+#endif
+	return 0;
+}
+
+/* Block-driver specific functions */
+static int fl_do1_request(FL_DEV *device, struct request *req)
+{
+	/* Do the I/O for _one_ request, but don't mess with the request queues. */
+	/* All validity checking done before calling this fn. */
+
+	unsigned int    blocks;
+	unsigned int    block;
+	void           *buffer;
+	int             minor;
+	int             dev_nr;
+	int fl_last_error=0;
+
+	// get device information
+	dev_nr = DEVICE_NR(req->rq_dev);
+	minor = MINOR(req->rq_dev);
+
+	// get io information
+	blocks = req->current_nr_sectors;
+	buffer = req->buffer;
+	block = req->sector;
+
+	// translate through partition table
+	block += Fl_partitions[minor].start_sect;
+
+	/* iterate doing io until we are done */
+	for (; blocks--; block++, buffer += 512)
+	{
+		// determine if we are READing or WRITEing, then select io type
+		switch (req->cmd)
+		{
+		case READ:
+			device->requests_Read++;
+			fl_last_error=FlRead(dev_nr, buffer, block, 1);
+			if(!fl_last_error)
+			{
+				return 0;
+			}
+			break;
+
+		case WRITE:
+			device->requests_Write++;
+			fl_last_error=FlWrite(dev_nr, buffer, block, 1);
+			if(!fl_last_error)
+			{
+				return 0;
+			}
+			break;
+		}
+	}
+	return 1;
+}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+void fl_request_fn1(request_queue_t *q)
+#else
+void fl_request_fn1(void)
+#endif	/* < 2.4.0 */
+{
+	// Move all the requests into the private device queue.
+	struct request *req;
+	FL_DEV         *device;
+	int             minor;
+	int             dev_nr;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	int             code;
+#endif
+
+	// Standard block device request loop
+	//
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	while (code = 0, !QUEUE_EMPTY)
+#else
+	while (1)
+#endif
+	{
+		// Standard block device boiler plate
+		INIT_REQUEST;
+		req = CURRENT;
+
+		// get device information
+		dev_nr = CURRENT_DEV;
+		minor = MINOR(req->rq_dev);
+
+		// Check if the minor number is in range 
+		if ((dev_nr > fl_gendisk.nr_real) || (minor > MINOR_NR(fl_gendisk.nr_real)))
+		{
+			static int      count = 0;
+			if (count++ < 5)    // print the message at most five times 
+				printk(KERN_WARNING DEVICE_NAME": _request_fn: request for non-existent device\n");
+			end_request(0);
+			continue;
+		}
+		// get device structure
+		device = Fl_devices + dev_nr;
+		device->requests++;
+		// check we are in range
+		if ((req->sector + req->current_nr_sectors) > fl_gendisk.part[minor].nr_sects)
+		{
+			printk(KERN_WARNING DEVICE_NAME": _request_fn: request past end of device: %4lx >= %4lx\n",req->sector + req->current_nr_sectors, fl_gendisk.part[minor].nr_sects);
+			if (req->sector != 0)
+			{
+				end_request(0);
+				continue;
+			}
+		}
+		// check we have a valid command
+		if (req->cmd != READ && req->cmd != WRITE)
+		{
+			end_request(0);
+			continue;
+		}
+
+		// Check that there is somebody to handle it :).
+		if (NULL == device->sem)
+		{
+			// Oops, there isn't.
+			end_request(0);
+			continue;
+		}
+
+		if(req->cmd==WRITE && FlGetProtection(DEVICE_NR(req->rq_dev))>=1)
+		{
+			end_request(0);
+			continue;
+		}
+		if(req->cmd==READ && FlGetProtection(DEVICE_NR(req->rq_dev))>=2)
+		{
+			end_request(0);
+			continue;
+		}
+
+		// Move to private list (io_request_lock aquired before calling this request fn).
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+		list_del(&req->queue);
+		INIT_LIST_HEAD(&req->queue);
+		list_add_tail(&req->queue,&device->queue_head);
+#else
+		// no easy way to add to tail for singly linked list,
+		// so build list in reverse order and flip it when processing starts
+		CURRENT = req->next;
+		req->next = device->revq;
+		device->revq = req;
+#endif
+		// Make sure the next stage is set up to run.  We can
+		// do this more than once because it's a semaphore,
+		// and we _must_ do it now because some kernel versions
+		// have a function exit inside the INIT_REQUEST macro
+		// used above.
+		up(device->sem);
+	}
+}
+
+static struct request*gimme_req(FL_DEV *device)
+{
+	struct request *req;
+	unsigned long flags;
+
+	// Use the same lock that's protecting fl_request_fn1()
+	grab_io_request_lock(flags);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	req = list_empty(&device->queue_head) ? NULL :list_entry(device->queue_head.next,struct request,queue);
+#else
+	if (NULL == (req = device->queue) && NULL != (req = device->revq))
+	{
+		// There are none on the private queue, but the reversed
+		// queue has at least one, flip the reversed queue into
+		// the private queue.
+		do{
+			device->revq = req->next;
+			req->next = device->queue;
+			device->queue = req;
+		}while (NULL != (req = device->revq));
+		// Pick up the first request
+		req = device->queue;
+	}
+#endif
+	/* A tiny bit of paranoia from INIT_REQ */
+	if (NULL != req && NULL != req->bh)
+	{
+		if (!buffer_locked(req->bh))
+			panic(DEVICE_NAME ": block not locked");
+	}
+	/* End paranoia */
+	rlse_io_request_lock(flags);
+	return(req);
+}
+
+static void request_completed(FL_DEV *device, struct request *req,int result)
+{
+	// Do the equivalent of end_request(1), but don't use "CURRENT"
+	unsigned long flags;
+	/* We really don't need to lock just yet, because the request is in
+	   our private queue and we won't be returning it to the public free
+	   list until _after_ end_that_request_first() returns 0. */
+	if (end_that_request_first(req,result,DEVICE_NAME))
+	{
+		// This request is multi-sector and is not finished yet,
+		// the various buffer pointers and counters have been adjusted,
+		// but we need another crack at the remaining sectors.
+		return;
+	}
+#if !defined(DEVICE_NO_RANDOM)
+	add_blkdev_randomness(MAJOR(req->rq_dev));
+#endif
+	grab_io_request_lock(flags);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	blkdev_dequeue_request(req);
+	INIT_LIST_HEAD(&req->queue);
+#else
+	device->queue = req->next;
+	req->next = NULL;
+#endif
+	end_that_request_last(req);
+	rlse_io_request_lock(flags);
+}
+
+/* Note: this runs as a kernel thread without aquired locks, so any list operations must aquire the appropriate lock. (See gimme_req() and request_completed(), above.) */
+/* struct task_struct current */
+int fl_request_fn2(void *data)
+{
+	FL_DEV         *device = (FL_DEV *) data;
+	struct request *req;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	DECLARE_MUTEX_LOCKED(reqs2do);
+#else
+	struct semaphore reqs2do = MUTEX_LOCKED;
+#endif
+	struct semaphore *initterm = device->sem;
+
+	/* Detach as best we can from the process that started us. */
+	lock_kernel();
+	exit_mm(current);
+	exit_files(current);
+	exit_fs(current);
+	fl_setsid();
+	current->exit_signal = SIGCHLD;
+	/* QQQ should terminate when we detect 'em.....if we detect 'em */
+	siginitsetinv(&current->blocked, SHUTDOWN_SIGS);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	spin_lock(&current->sigmask_lock);
+	flush_signals(current);
+	spin_unlock(&current->sigmask_lock);
+#else
+	sigemptyset(&current->signal);
+#endif
+	/* Name this thread */
+	sprintf(current->comm, "msys/fl%c", 'a'+(device-Fl_devices));
+	/* Run at a high priority, ahead of sync and friends */
+	/* QQQ priority > bdflush??? */
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	current->nice = prio;
+#else
+	current->priority = prio;
+#endif
+	current->policy = SCHED_OTHER;
+	/* Replace the initialization/termination semaphore with our "requests to do" semaphore. */
+	device->sem = &reqs2do;
+	unlock_kernel();
+
+	/* Let the process that started us know we are ready to roll. */
+	up(initterm);
+	// Process all requests for this device.
+	while (!device->terminating)
+	{
+		/* Wait for some requests. */
+		down(device->sem);
+		/* Do 'em. */
+		while (NULL != (req = gimme_req(device)))
+		{
+			request_completed(device,req,fl_do1_request(device,req));
+		}
+	}
+	// Let the process terminating us know we are done. */
+	up(initterm);
+	return(0);
+}
+
+static void kickoff_thread(FL_DEV *device, int (*th_fn)(void *data))
+{
+	device->terminating = 0;
+	device->sem = &start_stop_sem;
+	kernel_thread(th_fn,(void *)device,0);
+	/* Wait for the function to finish initialization. */
+	down(&start_stop_sem);
+}
+
+static void killoff_thread(FL_DEV *device)
+{
+	if (NULL == device->sem || device->terminating)
+	{
+		/* It's already dead or dying. */
+		return;
+	}
+	/* Tell the thread to quit. */
+	device->terminating = 1;
+	/* Wake up the function for the last time (if it isn't already awake). */
+	up(device->sem);
+	/* Wait for the function to finish termination. */
+	down(&start_stop_sem);
+	/* Make sure no one tries to wake up the function again. */
+	device->sem = NULL;
+}
+
+#define fl_init init_module
+
+static void fl_geninit(struct gendisk *gendisk)
+{
+	int mdev;
+	FL_DEV*device;
+	int	bDevice;
+
+	/* iterate across the per minor device arrays and prepare them */
+	for (mdev = 0; mdev < MINOR_NR(gendisk->nr_real); mdev++)
+	{
+		/* prepare the Fl_blksize_size array and zero it */
+		Fl_blksize_size[mdev] = blksize[mdev>>FL_SHIFT];
+		/* prepare the Fl_hardsect_size array and zero it */
+		Fl_hardsect_size[mdev] = hardsect[mdev>>FL_SHIFT];
+		Fl_blk_size[mdev] = 0;
+	}
+
+	/* iterate across the flash devices filling in the device information structure */
+	for(bDevice=0;bDevice<gendisk->nr_real;bDevice++)
+	{
+		// we still increment dev
+		// so that we can access the underlying device via ioctls for formatting etc
+		device = Fl_devices + bDevice;
+
+		/* We have a private queue per physical device, but only one "public" queue for the major number */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+		INIT_LIST_HEAD(&device->queue_head);
+#else
+		device->queue = device->revq = NULL;
+#endif
+		kickoff_thread(device,fl_request_fn2);
+
+		/* remove read protection */
+		if(bDevice==fl_part_prot)
+		{
+			if(!FlRemoveProtectionFromParm(fl_part_prot,fl_key_prot))
+			{
+				printk(KERN_ERR DEVICE_NAME": device %d: Error removing protection.\n",(int)bDevice);
+			}
+		}
+		/* does this DOC volume exist? */
+		if(FlMount(bDevice))
+		{
+			/* start to fill in the required info */
+			device->volume = bDevice;
+			device->size=FlGetNumberOfSectors(bDevice);
+
+			Fl_blk_size[MINOR_NR(bDevice)] = device->size;
+			Fl_blksize_size[MINOR_NR(bDevice)] = 1024;
+			Fl_partitions[MINOR_NR(bDevice)].start_sect = 0;
+			Fl_partitions[MINOR_NR(bDevice)].nr_sects = 0;
+		}
+		else
+		{
+			/* start to fill in the required info */
+			device->volume = -1;
+			device->size = 0;
+
+			Fl_blk_size[MINOR_NR(bDevice)] = 0;
+			Fl_blksize_size[MINOR_NR(bDevice)] = 0;
+			Fl_partitions[MINOR_NR(bDevice)].start_sect = 0;
+			Fl_partitions[MINOR_NR(bDevice)].nr_sects = 0;  
+		}
+	}
+
+	/* fill in partition info for whole disks so we can do resetup_one_dev() */
+	for (bDevice=0;bDevice<gendisk->nr_real;bDevice++)
+	{
+		device = Fl_devices+bDevice;
+		Fl_partitions[MINOR_NR(bDevice)].nr_sects = device->size; 
+	}
+
+	/* fill in the gendisk structure  */
+	gendisk->sizes = Fl_blk_size;
+
+	/* set global variables */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	blk_init_queue(BLK_DEFAULT_QUEUE(flMajor),fl_request_fn1);
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+	blk_dev[flMajor].request_fn = fl_request_fn1;
+#endif	/* >= 2.4.0 */
+	read_ahead[flMajor] = Fl_read_ahead;
+	blk_size[flMajor] = Fl_blk_size;
+	blksize_size[flMajor] = Fl_blksize_size;
+	hardsect_size[flMajor] = Fl_hardsect_size;
+
+	// call resetup/register_disk for each physical device
+	for(bDevice=0;bDevice<gendisk->nr_real;bDevice++)
+	{
+		device = Fl_devices+bDevice;
+		if (device->size)
+		{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+			register_disk(gendisk,MKDEV(flMajor,(bDevice<<gendisk->minor_shift)),gendisk->max_p,gendisk->fops,device->size);
+#else
+			resetup_one_dev(gendisk,bDevice);
+#endif
+		}
+	}
+
+	// grab blk_size information and spit out some info
+	for (mdev = 0; mdev < MINOR_NR(gendisk->nr_real); mdev++)
+	{
+		Fl_blk_size[mdev] = Fl_partitions[mdev].nr_sects / 2;
+
+		if ((mdev%64 == 0) || (mdev%64 == 1)  || (mdev%64 == 2) || (mdev%64 == 3))
+		{
+			printk(KERN_INFO DEVICE_NAME": partition: %d: start_sect: %lx, nr_sects: %lx Fl_blk_size[]: %xkb\n",mdev, Fl_partitions[mdev].start_sect, Fl_partitions[mdev].nr_sects, Fl_blk_size[mdev]);
+		}
+	}
+
+	return;
+}
+
+/* DDD Here for debugging
+ * print out the size of the request queue when /proc/fla_queue is read. */
+static int fl_read_proc(char *buffer, char **start, off_t offset,int length, int *eof, void *data)
+{
+	int len;
+	off_t begin=0;
+
+	len = sprintf(buffer, "ReadQ WriteQ\n%5d %6d\n",Fl_devices->requests_Read,Fl_devices->requests_Write);
+
+	if (len<offset)
+	{
+		begin = len;
+		len=0;
+		*eof = 1;
+	}
+	*start = buffer+(offset-begin);
+	len-=(offset-begin);
+	if (len < 0)
+	{
+		len = 0;
+	}
+	if (len > length)
+	{
+		len = length;
+	}
+	return len;
+}
+
+#ifdef COTULLA
+#define MSC2_CNTR_REG_ADDR 0x48000000
+#define MSC2_OFFSET        0x10
+#define MCS5_INIT_VAL      0xFFF80000
+#endif
+
+/* Init DiskOnChip CS in H/W if needed */
+void fl_docCsInit( void )
+{
+#ifdef COTULLA
+  volatile void *myMSC2ptr;
+  unsigned long msc2Val;
+  
+  myMSC2ptr = (volatile void *)ioremap_nocache(MSC2_CNTR_REG_ADDR, 0x1000);
+  /* MSC2 Static Memory Control Register - 16-bit mode for CS5 */
+  msc2Val = readl( myMSC2ptr + MSC2_OFFSET );
+  writel( ((msc2Val & 0x0000FFFF) | MCS5_INIT_VAL), myMSC2ptr + MSC2_OFFSET );
+/*  *(myMCS5 + 4) = MCS5_INIT_VAL; */
+  iounmap( (void *)myMSC2ptr ); 
+#endif
+}
+
+/* Initialize the DiskOnChip Memory and Chip Select if needed */
+int fl_mapPhysMem( unsigned long winl, unsigned long winh )
+{
+  unsigned long docSize = FL_DOC_WIN_SIZE + (winh - winl);
+  unsigned long docAddr = winl;
+
+  /* Init DiskOnChip CS in H/W if needed */
+  fl_docCsInit(); 
+
+#if 0
+  if( !request_mem_region( docAddr, docSize, "fla") ) {
+    printk(KERN_ERR "fl_mapPhysMem: request region failure %lx\n",docAddr);
+    return 1;
+  }
+#endif
+  
+  /* Get Mapped address */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+  fl_virl = (void *)ioremap_nocache( docAddr, docSize );
+#else
+  fl_virl = docAddr;
+#endif  
+  fl_virh = fl_virl + (docSize - FL_DOC_WIN_SIZE);
+  return 0;
+}
+
+/* Release the DiskOnChip Memory */
+void fl_releasePhysMem( unsigned long winl, unsigned long winh )
+{
+#if 0
+  unsigned long docSize = FL_DOC_WIN_SIZE + (winh - winl);
+#endif  
+  if( fl_virl ) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+    iounmap( fl_virl );
+#endif    
+#if 0    
+    release_mem_region( winl, docSize );
+#endif    
+  } 
+}
+
+/* Initialize the driver, register major and link into gendisk_list. */
+#if defined(__init)
+int __init fl_init(void)
+#elif defined(__initfunc)
+__initfunc( int fl_init(void))
+#else
+int fl_init(void)
+#endif
+{
+	int result = 0;
+	int i;
+
+#ifdef DEEPDEBUG
+	printk(KERN_DEBUG"linuxdrv begin\n");
+#endif	/* DEEPDEBUG */
+
+	// Map Physical Memory of the DiskOnChip window
+	if( fl_mapPhysMem( fl_winl, fl_winh ) ) {
+		printk(KERN_ERR"Cannot Map M-Systems DiskOnChip Memory\n");
+		goto fl_init_error;
+	}
+	
+	// Copy the (static) cfg variables to public prefixed ones to allow snoozing with a debugger.
+	// major device number
+	flMajor = major;		/* 100 by default */
+	Fl_read_ahead = rahead;	/* 0 by default */
+
+	// set default blksize and hardsect if they where not passed as module parameters
+	for (i = 0; i < MAX_DEVICES; i++)
+	{
+		if (!blksize[i])
+			blksize[i] = 1024;
+		if (!hardsect[i])
+			hardsect[i] = 512;
+	}
+
+	spin_lock_init(&o_c_lock);
+
+	// can we initialize OSAK?
+	if(!FlInit())
+	{
+		printk(KERN_ERR DEVICE_NAME": Cannot initialize M-Systems DOC 2000 OSAK\n");
+		goto fl_init_error;
+	}
+
+	DebugPrintk("fl_init: FlInit OK\n");
+
+	/* find out how many devices we have */
+	if(!(fl_gendisk.nr_real=FlGetNumberOfDevices(MAX_DEVICES)))
+	{
+		printk(KERN_ERR DEVICE_NAME": Cannot find any M-Systems flash devices\n");
+		goto fl_init_error;		
+	}
+	DebugPrintk("fl_init: Found %d devices\n",fl_gendisk.nr_real);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
+	fl_gendisk.max_nr = fl_gendisk.nr_real;  // for the sake of parnoia...
+#endif
+	// partition array must be allocated here, setup_dev() accesses it before calling fl_genit()
+	if (!(Fl_partitions = ckmalloc(MINOR_NR(fl_gendisk.nr_real) * sizeof(struct hd_struct), GFP_KERNEL)))
+		goto fl_init_error;
+
+	// allocate per device dynamic structures, these are done here so we can release ckmalloc()
+	if (!(Fl_devices = ckmalloc(fl_gendisk.nr_real * sizeof(FL_DEV), GFP_KERNEL)))
+		goto fail_malloc;
+
+	// allocate per device * minor blk dynamic arrays
+	if (!(Fl_blksize_size = ckmalloc(MINOR_NR(fl_gendisk.nr_real) * sizeof(unsigned int), GFP_KERNEL)))
+		goto fail_malloc;
+
+	if (!(Fl_hardsect_size = ckmalloc(MINOR_NR(fl_gendisk.nr_real) * sizeof(unsigned int), GFP_KERNEL)))
+		goto fail_malloc;
+
+	if (!(Fl_blk_size = ckmalloc(MINOR_NR(fl_gendisk.nr_real) * sizeof(unsigned int), GFP_KERNEL)))
+		goto fail_malloc;
+
+	// setup gendisk structure with partition information
+	fl_gendisk.part = Fl_partitions;
+
+	/* ok, we have at least one DOC, proceed */
+	printk(KERN_INFO DEVICE_NAME": Flash disk driver for DiskOnChip\n");
+	printk(KERN_INFO DEVICE_NAME": DOC device(s) found: %d\n", fl_gendisk.nr_real);
+
+	// Register your major, and/or accept a dynamic number
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	if ((result = devfs_register_blkdev(flMajor,DEVICE_NAME,&fl_fops)) < 0)
+#else
+	if ((result = register_blkdev(flMajor,DEVICE_NAME,&fl_fops)) < 0)
+#endif
+	{
+		printk(KERN_WARNING DEVICE_NAME": can't get major %d\n",flMajor);
+		goto fail_malloc;
+	}
+
+	/* save major if we are using a dynamic major */
+	if (flMajor == 0)
+	{
+		flMajor = result;			/* dynamic */
+	}
+
+	fl_gendisk.major = flMajor;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	devfs_handle = devfs_mk_dir(NULL, fl_gendisk.major_name, NULL);
+	/* DDD this is in here for debugging */
+	create_proc_read_entry("fl_queue", 0, 0, fl_read_proc, NULL);
+#endif // >= 2.4.0
+
+	printk(KERN_INFO DEVICE_NAME": _init: registered device at major: %d\n",flMajor);
+
+	/* link into global gendisk list */
+	fl_gendisk.next = gendisk_head;
+	gendisk_head = &fl_gendisk;
+
+	fl_geninit(&fl_gendisk);
+
+	return 0;
+
+fail_malloc:
+
+	// Reset global block array entries
+	// QQQ - the first part of this cleanup does not make real sense,
+	//       we have not done the setup until fl_geninit(), and we
+	//       will not be getting to here once we have called it.
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	blk_cleanup_queue(BLK_DEFAULT_QUEUE(flMajor));
+	devfs_unregister_blkdev(flMajor,DEVICE_NAME);
+#else
+	blk_dev[flMajor].request_fn = NULL;
+#endif // >= 2.4.0
+	read_ahead[flMajor] = 0;
+	blk_size[flMajor] = NULL;
+	blksize_size[flMajor] = NULL;
+	hardsect_size[flMajor] = NULL;
+
+	// Failed, free any memory that was allocated and set pointers to NULL
+	lkfree((void **)&Fl_devices);
+	lkfree((void **)&Fl_blksize_size);
+	lkfree((void **)&Fl_hardsect_size);
+	lkfree((void **)&Fl_blk_size);
+	lkfree((void **)&Fl_partitions);
+
+fl_init_error:
+    	fl_releasePhysMem( fl_winl, fl_winh );
+	return(1);
+}
+
+void cleanup_module(void)
+{
+	int             i;
+	struct gendisk**gd;
+	int	bDevice;
+
+	/* first of all, flush it all and reset all the data structures */
+	for (i = 0; i < MINOR_NR(fl_gendisk.nr_real); i++)
+	{
+		fsync_dev(MKDEV(flMajor, i));  /* flush the devices */
+	}
+
+	/* Terminate the request threads. */
+	for (i = 0; i < fl_gendisk.nr_real; i++)
+	{
+		 killoff_thread(Fl_devices+i);
+	}
+
+	for(bDevice=0;bDevice<fl_gendisk.nr_real;bDevice++)
+	{
+		FlDismount(bDevice);
+	}
+
+	/* remove our gendisk structure from the global linked list */
+	for (gd = &gendisk_head; *gd; gd = &((*gd)->next))
+	{
+		if (*gd == &fl_gendisk)
+		{
+			*gd = (*gd)->next;
+			break;
+		}
+	}
+
+	// complain if we didn't find ourselves in gendisk list
+	if (!*gd)
+	{
+		printk(KERN_ERR DEVICE_NAME": cleanup_module: entry in gendisk chain missing!\n" );
+	}
+
+	// reset global blk array entries
+	read_ahead[flMajor] = 0;
+	blk_size[flMajor] = NULL;
+	blksize_size[flMajor] = NULL;
+	hardsect_size[flMajor] = NULL;
+
+	// unregister our device
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	devfs_unregister_blkdev(flMajor, DEVICE_NAME);
+	blk_cleanup_queue(BLK_DEFAULT_QUEUE(flMajor));
+	devfs_unregister(devfs_handle);
+	devfs_handle = NULL;
+	// DDD again, this is for debugging
+	remove_proc_entry("fl_queue", 0);
+#else
+	blk_dev[flMajor].request_fn = NULL;
+	unregister_blkdev(flMajor, DEVICE_NAME);
+#endif	/* >= 2.4.0 */
+
+	/* free our data structures */
+	lkfree((void **)&Fl_blk_size);
+	lkfree((void **)&Fl_blksize_size);
+	lkfree((void **)&Fl_hardsect_size);
+	lkfree((void **)&Fl_devices);
+	lkfree((void **)&Fl_partitions);
+	printk(KERN_INFO DEVICE_NAME": Driver removed.\n");
+}
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
+
+static void spin_lock_init(spinlock_t *splp)
+{
+	splp->lock = 0;
+}
+
+static void spin_lock(spinlock_t *splp)
+{
+	/* spin on bit lock */
+	while (set_bit(0,&(splp->lock)) != 0)/* spin */;
+}
+
+static void spin_unlock(spinlock_t *splp)
+{
+	/* unlock simple bit lock */
+	if (clear_bit(0,&(splp->lock)) == 0)
+	{
+		printk(KERN_ERR DEVICE_NAME": spin_unlock() failed\n");
+	}
+}
+
+/* Signals */
+
+static void siginitsetinv(sigset_t *set, unsigned long mask)
+{
+	*set = ~mask;
+}
+
+static void sigemptyset(sigset_t *set)
+{
+	*set = 0;
+}
+
+/* copy user space to/from kernel space */
+
+static inline unsigned long copy_to_user(void *to,const void *from, unsigned long n)
+{
+	int i;
+	if ((i = verify_area(VERIFY_WRITE, to, n)) != 0)
+		return i;
+	memcpy_tofs(to, from, n);
+	return 0;
+}
+
+static inline unsigned long copy_from_user(void *to,const void *from, unsigned long n)
+{
+	int i;
+	if ((i = verify_area(VERIFY_READ, from, n)) != 0)
+	{
+		return i;
+	}
+	memcpy_fromfs(to, from, n);
+	return 0;
+}
+
+/* I/O requests and locking */
+
+static int end_that_request_first(struct request *req,int uptodate,char *devname)
+{
+	struct buffer_head * bh;
+	int nsect;
+
+	req->errors = 0;
+	if (!uptodate)
+	{
+		printk(KERN_ERR DEVICE_NAME": msys/fl/end_request_1st: I/O error, dev %s (%s), sector %lu\n",kdevname(req->rq_dev), devname, req->sector);
+		if (NULL != (bh = req->bh))
+		{
+			nsect = bh->b_size >> 9;
+			req->nr_sectors--;
+			req->nr_sectors &= ~(nsect - 1);
+			req->sector += nsect;
+			req->sector &= ~(nsect - 1);
+		}
+	}
+
+	if (NULL != (bh = req->bh))
+	{
+		req->bh = bh->b_reqnext;
+		bh->b_reqnext = NULL;
+
+		mark_buffer_uptodate(bh, uptodate);
+		unlock_buffer(bh);
+		if (NULL != (bh = req->bh))
+		{
+			req->current_nr_sectors = bh->b_size >> 9;
+			if (req->nr_sectors < req->current_nr_sectors)
+			{
+				req->nr_sectors = req->current_nr_sectors;
+				printk(KERN_ERR DEVICE_NAME": msys/fl/end_request_1st: buffer-list destroyed\n");
+			}
+			req->buffer = bh->b_data;
+			return 1;
+		}
+	}
+	return 0;
+}
+
+static void end_that_request_last(struct request *req)
+{
+	if (NULL != req->sem)
+	{
+		up(req->sem);
+	}
+	req->rq_status = RQ_INACTIVE;
+	wake_up(&wait_for_request);
+}
+
+#endif	/* LINUX_VERSION_CODE < 2.1.0 */
+
+/*****************	EXPORTED TO TRUEFFS	*****************/
+
+short GetFlDebugParam(void)
+{
+	return fl_debug;
+}
+
+void GetFlParams(unsigned long*p_fl_winl,unsigned long*p_fl_winh,
+	unsigned char*p_fl_is_ram_check,unsigned char*p_fl_nftl_cache,
+	unsigned char*p_fl_8bit_access,unsigned long*p_fl_mtd_bus_access_type,
+	unsigned long*p_fl_verify_write_bdtl,unsigned long*p_fl_verify_write_binary,
+	unsigned long*p_fl_verify_write_other,unsigned long*p_fl_sectors_verified_per_folding)
+{
+	*p_fl_winl=(unsigned long)fl_virl;
+	*p_fl_winh=(unsigned long)fl_virh;
+	*p_fl_is_ram_check=fl_is_ram_check;
+	*p_fl_nftl_cache=fl_nftl_cache;
+	*p_fl_8bit_access=fl_8bit_access;
+	*p_fl_mtd_bus_access_type=fl_mtd_bus_access_type;
+	*p_fl_verify_write_bdtl=fl_verify_write_bdtl;
+	*p_fl_verify_write_binary=fl_verify_write_binary;
+	*p_fl_verify_write_other=fl_verify_write_other;
+	*p_fl_sectors_verified_per_folding=fl_sectors_verified_per_folding;
+}
+
+/* The following are the Linux versions of various things required by the M-Systems OSAK that must be compiled here in the Linux kernel environment. */
+void flDelayMsecs(unsigned milliseconds)
+{
+	register int    i;
+	for (i = 0; i < milliseconds; i++)
+		udelay(1000L);
+}
+
+void flsleep(unsigned long milliseconds)
+{
+	unsigned long deltaj;
+	/* Timeout has to be expressed in jiffies, there are HZ jiffies/sec. 
+	We add one to it anyway, because the "first" jiffy is really some
+	random fraction of a jiffy. */
+	deltaj = 1 + ((HZ * milliseconds) / 1000);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,0)
+	/* QQQ: why TASK_UNINTERRUPTIBLE? */
+	current->state = TASK_UNINTERRUPTIBLE;
+	while ((deltaj = schedule_timeout(deltaj)) > 0) /* skip */ ;
+#else
+	current->timeout = jiffies + deltaj;
+	current->state = TASK_INTERRUPTIBLE; /* uninterruptible => no timeout ! */
+	schedule();
+	current->timeout = 0;
+#endif
+}
+
+void *flmemcpy(void *dest, const void *src, size_t length)
+{
+	return(memcpy(dest, src, length));
+}
+
+void *flmemset(void *dest, int value, unsigned int length)
+{
+	return(memset(dest, value, length));
+}
+
+int flmemcmp(const void * dest,const void  *src,size_t count)
+{
+	return(memcmp(dest, src, count));
+}
+
+/*
+ * Do not use isa_xxx() functions in order to access memory because
+ * they are x86 specific and doesn't get proper virtual address from MMU
+ * Instead use the pointer from ioremap_nocache(physAddr) with usual access
+ * functions.
+ */
+void flmemcpy_fromio(void *dest, const void * src, unsigned int length)
+{
+/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	isa_memcpy_fromio(dest, (unsigned long)src, length);
+#else
+	memcpy_fromio(dest, src, length);
+#endif
+*/
+	memcpy_fromio(dest, src, length);
+}
+
+void flmemcpy_toio(void *dest, const void * src, unsigned int length)
+{
+/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	isa_memcpy_toio((unsigned long)dest, src, length);
+#else
+	memcpy_toio(dest, src, length);
+#endif
+*/
+	memcpy_toio(dest, src, length);
+}
+
+void flmemset_io(void *dest, int value, unsigned int length)
+{
+/*#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
+	isa_memset_io((unsigned long)dest, value, length);
+#else
+	memset_io(dest, value, length);
+#endif
+*/
+	memset_io(dest, value, length);
+}
+
+void *flmalloc(unsigned long size)
+{
+	return vmalloc(size);
+}
+
+void flfree(void*addr)
+{
+	vfree(addr);
+}
+
+void FlDebugPrint(char*str)
+{
+	if(GetFlDebugParam())
+	{
+		LOG_DELAY;
+		printk(KERN_DEBUG DEVICE_NAME": %s",str);
+	}
+}
+
+void FlErrorPrint(char*str,int stat)
+{
+	LOG_DELAY;
+	printk(KERN_DEBUG DEVICE_NAME": Error %s: %d\n",str,stat);
+}
+
+#ifdef DEEPDEBUG
+int FlPrintk(const char *fmt, ...)
+{
+	va_list args;
+	char buf[1024];     // hopefully enough, kernel/printk.c thinks so
+	int i;
+
+	va_start(args, fmt);
+	i = vsprintf(buf, fmt, args); 
+	va_end(args);
+	// make sure we have terminated the string
+	buf[i--] = '\0';
+
+	// libosak uses \n\r, this make kerneld unhappy
+	if (buf[i-1] == '\n' && buf[i] == '\r')
+		buf[i--] = '\0';
+	LOG_DELAY;
+	printk(KERN_DEBUG"fl :%s",buf);
+	return(i);
+}
+
+void FlLogData(unsigned short*wBuffPtr,unsigned short wLen,unsigned char fWrite)
+{
+	unsigned short w=0;
+
+	LOG_DELAY;
+	if(fWrite)
+	{
+		printk(KERN_DEBUG DEVICE_NAME": Write %u words\n",wLen);
+	}
+	else
+	{
+		printk(KERN_DEBUG DEVICE_NAME": Read %u words\n",wLen);
+	}
+
+	LOG_DELAY;
+	while(w<wLen)
+	{
+		unsigned short w1;
+
+		for(w1=0;w1<16&&w<wLen;w1++,w++)
+		{
+			printk("%4.4x ",wBuffPtr[w]);
+		}
+		printk("\n");
+	}
+}
+#endif	/* DEEPDEBUG */
+
+unsigned char flreadb(volatile void *addr)
+{
+	return(readb(addr));
+}
+
+unsigned short flreadw(volatile void *addr)
+{
+	return(readw(addr));
+}
+
+unsigned long flreadl(volatile void *addr)
+{
+	return(readl(addr));
+}
+
+void flwriteb(unsigned char value, volatile void *addr)
+{
+	writeb(value, addr);
+}
+
+void flwritew(unsigned short value, volatile void*addr)
+{
+	writew(value, addr);
+}
+
+void flwritel(unsigned long value, volatile void *addr)
+{
+	writel(value, addr);
+}
+
+unsigned int flRandByte(void)
+{
+	struct timeval time;
+	do_gettimeofday(&time);
+	return (time.tv_usec >> 1) & 0xff;
+}
+
+void *flAddLongToFarPointer(void*ptr, unsigned long offset)
+{
+	return (void*)(((unsigned long)(ptr)) + offset);
+}
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
+static struct semaphore osak_sem;
+#else
+static struct semaphore osak_sem=MUTEX_LOCKED;
+#endif
+
+void flSysfunInit(void)
+{
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
+	sema_init(&osak_sem,1);
+#endif
+}
+
+int flCreateMutex(int*mutex)
+{
+	up(&osak_sem);
+	return 0;
+}
+
+void flDeleteMutex(int*mutex)
+{
+	up(&osak_sem);
+}
+
+int flTakeMutex(int*mutex)
+{
+	down(&osak_sem);
+	return 1;
+}
+
+void flFreeMutex(int*mutex)
+{
+	up(&osak_sem);
+}
Index: drivers/block/doc/fldrvlnx.h
diff -u /dev/null drivers/block/doc/fldrvlnx.h:1.1.2.1
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/block/doc/fldrvlnx.h	Mon May 12 07:07:23 2003
@@ -0,0 +1,62 @@
+/*
+ * $Log: fldrvlnx.h,v $
+ * Revision 1.1.2.1  2003/05/12 14:07:23  grimiore
+ *
+ * m-system's DiskOnChip kernel hacks. Adds in TrueFFS v 5.1.4 binary-only driver
+ *
+ */
+
+/***********************************************************************************/
+/*                        M-Systems Confidential                                   */
+/*           Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2001            */
+/*                         All Rights Reserved                                     */
+/***********************************************************************************/
+/*                            NOTICE OF M-SYSTEMS OEM                              */
+/*                           SOFTWARE LICENSE AGREEMENT                            */
+/*                                                                                 */
+/*      THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE                 */
+/*      AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT           */
+/*      FOR THE SPECIFIC TERMS AND CONDITIONS OF USE,                              */
+/*      OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE:                               */
+/*      E-MAIL = info@m-sys.com                                                    */
+/***********************************************************************************/
+
+#ifndef __FLDRVLNX__H__
+#define __FLDRVLNX__H__
+
+#include <linux/sockios.h> /* for SIOCDEVPRIVATE */
+
+typedef enum{FL_IOCTL_GET_INFO = SIOCDEVPRIVATE,
+             FL_IOCTL_DEFRAGMENT,
+             FL_IOCTL_WRITE_PROTECT,
+             FL_IOCTL_MOUNT_VOLUME,
+             FL_IOCTL_FORMAT_VOLUME,
+             FL_IOCTL_BDK_OPERATION,
+             FL_IOCTL_DELETE_SECTORS,
+             FL_IOCTL_READ_SECTORS,
+             FL_IOCTL_WRITE_SECTORS,
+             FL_IOCTL_FORMAT_PHYSICAL_DRIVE,
+             FL_IOCTL_FORMAT_LOGICAL_DRIVE,
+             FL_IOCTL_BDTL_HW_PROTECTION,
+             FL_IOCTL_BINARY_HW_PROTECTION,
+             FL_IOCTL_OTP,
+             FL_IOCTL_CUSTOMER_ID,
+             FL_IOCTL_UNIQUE_ID,
+             FL_IOCTL_NUMBER_OF_PARTITIONS,
+             FL_IOCTL_INQUIRE_CAPABILITIES,
+             FL_IOCTL_SET_ENVIRONMENT_VARIABLES, /* No longer supported */
+             FL_IOCTL_PLACE_EXB_BY_BUFFER,
+             FL_IOCTL_WRITE_IPL,                 /* No longer supported */
+             FL_IOCTL_DEEP_POWER_DOWN_MODE,
+             FL_IOCTL_EXTENDED_ENVIRONMENT_VARIABLES, 
+             FL_IOCTL_VERIFY_VOLUME,
+             FL_IOCTL_SET_ACCESS_ROUTINE,
+             FL_IOCTL_GET_ACCESS_ROUTINE,
+             FL_IOCTL_EXTENDED_WRITE_IPL
+} flIOctlFunctionNo;
+
+#ifndef FLASH_MAJOR
+#define FLASH_MAJOR	100
+#endif
+
+#endif	/*#ifndef __FLDRVLNX__H__*/
Index: drivers/block/doc/libosak
Index: drivers/block/doc/tffs2lnx.h
diff -u /dev/null drivers/block/doc/tffs2lnx.h:1.1.2.1
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/block/doc/tffs2lnx.h	Mon May 12 07:07:23 2003
@@ -0,0 +1,68 @@
+/*
+ * $Log: tffs2lnx.h,v $
+ * Revision 1.1.2.1  2003/05/12 14:07:23  grimiore
+ *
+ * m-system's DiskOnChip kernel hacks. Adds in TrueFFS v 5.1.4 binary-only driver
+ *
+ * 
+ */
+
+/***********************************************************************************/
+/*                        M-Systems Confidential                                   */
+/*           Copyright (C) M-Systems Flash Disk Pioneers Ltd. 1995-2002            */
+/*                         All Rights Reserved                                     */
+/***********************************************************************************/
+/*                            NOTICE OF M-SYSTEMS OEM                              */
+/*                           SOFTWARE LICENSE AGREEMENT                            */
+/*                                                                                 */
+/*      THE USE OF THIS SOFTWARE IS GOVERNED BY A SEPARATE LICENSE                 */
+/*      AGREEMENT BETWEEN THE OEM AND M-SYSTEMS. REFER TO THAT AGREEMENT           */
+/*      FOR THE SPECIFIC TERMS AND CONDITIONS OF USE,                              */
+/*      OR CONTACT M-SYSTEMS FOR LICENSE ASSISTANCE:                               */
+/*      E-MAIL = info@m-sys.com                                                    */
+/***********************************************************************************/
+
+#ifndef ___TFFS2LNX__H__
+#define ___TFFS2LNX__H__
+
+/* Set DiskOnChip Window Address */
+#define FL_DOC_WIN_SIZE		0x2000l
+#define FL_DOC_PHYS_ADDR_LOW	0xC8000l
+#define FL_DOC_PHYS_ADDR_HIGH	0xDE000l
+
+void fl_docCsInit( void );
+int fl_mapPhysMem( unsigned long winl, unsigned long winh );
+void fl_releasePhysMem( unsigned long winl, unsigned long winh );
+
+/* Driver Functions */
+unsigned char FlInit(void);
+unsigned char FlMount(unsigned char bDevice);
+unsigned char FlIsExist(unsigned char bDevice);
+unsigned char FlIsReadProt(unsigned char bDevice);
+unsigned char FlIsWriteProt(unsigned char bDevice);
+unsigned char FlGetProtection(unsigned char bDevice);
+unsigned char FlRemoveProtectionFromParm(unsigned char bHandle,unsigned char*pKey);
+unsigned char FlDismount(unsigned char bDevice);
+int FlGetNumberOfDevices(int max);
+unsigned long FlGetNumberOfSectors(unsigned char bDevice);
+unsigned char FlRead(unsigned char bDevice, void *data, int block, int count);
+unsigned char FlWrite(unsigned char bDevice, void *data, int block, int count);
+int FlIoctl(unsigned char bDevice, int cmd,unsigned long arg);
+
+#define MAX_DEVICES		64	/* "imported" from OSAK, MAX_DEVICES>=VOLUMES from flcustom.h */
+
+/* non-OSAK IOCTLs defenitions */
+#define FL_IOCTL_LNX	(FL_IOCTL_EXTENDED_WRITE_IPL+1)
+typedef struct
+{
+	unsigned long command;
+	unsigned long data;
+} flInputLnxRecord;
+typedef struct
+{
+	unsigned long status;
+	unsigned long data;
+} flOutputLnxRecord;
+/* end of non-OSAK IOCTLs defenitions */
+
+#endif	/* ___TFFS2LNX__H__ */
Index: drivers/char/Config.in
diff -u drivers/char/Config.in:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/char/Config.in:1.1.1.1.2.1
--- drivers/char/Config.in:1.1.1.1	Mon Dec 16 03:14:29 2002
+++ drivers/char/Config.in	Mon Dec 16 04:27:52 2002
@@ -169,6 +169,12 @@
    tristate '  Intel i810 TCO timer / Watchdog' CONFIG_I810_TCO
    tristate '  Mixcom Watchdog' CONFIG_MIXCOMWD 
    tristate '  SBC-60XX Watchdog Timer' CONFIG_60XX_WDT
+#   if [ "$CONFIG_TS_386" = "y" ]; then
+#   	tristate ' Technologic Systems 386EX SBC Watchdog Timer' CONFIG_TS386_WDT
+#   fi
+   if [ "$CONFIG_TS_M486" = "y" ]; then
+   	tristate ' Technologic Systems 5x00 SBC Watchdog Timer' CONFIG_TS486_WDT   
+   fi
    tristate '  W83877F (EMACS) Watchdog Timer' CONFIG_W83877F_WDT
    tristate '  ZF MachZ Watchdog' CONFIG_MACHZ_WDT
 fi
@@ -240,4 +246,7 @@
    tristate 'ACP Modem (Mwave) support' CONFIG_MWAVE
 fi
 
+if [ "$TSYSTEMS" = "y" ]; then
+  tristate ' Analog to Digital driver for Technologic Systems SBC' CONFIG_TSA2D
+fi
 endmenu
Index: drivers/char/Makefile
diff -u drivers/char/Makefile:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/char/Makefile:1.1.1.1.2.1
--- drivers/char/Makefile:1.1.1.1	Mon Dec 16 03:14:27 2002
+++ drivers/char/Makefile	Mon Dec 16 04:27:52 2002
@@ -34,6 +34,10 @@
 CONSOLE  =console.o
 SERIAL   =serial.o
 
+ifdef TSYSTEMS
+obj-y		+= auto485.o
+endif
+
 ifeq ($(ARCH),s390)
   KEYMAP   =
   KEYBD    =
@@ -215,6 +219,8 @@
 obj-$(CONFIG_NWBUTTON) += nwbutton.o
 obj-$(CONFIG_NWFLASH) += nwflash.o
 
+obj-$(CONFIG_TSA2D) += a2d_driver.o
+
 # Only one watchdog can succeed. We probe the hardware watchdog
 # drivers first, then the softdog driver.  This means if your hardware
 # watchdog dies or is 'borrowed' for some reason the software watchdog
@@ -226,6 +232,8 @@
 obj-$(CONFIG_IB700_WDT) += ib700wdt.o
 obj-$(CONFIG_MIXCOMWD) += mixcomwd.o
 obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
+obj-$(CONFIG_TS386_WDT) += ts_386wdt.o
+obj-$(CONFIG_TS486_WDT) += ts_486wdt.o
 obj-$(CONFIG_WDT) += wdt.o
 obj-$(CONFIG_WDTPCI) += wdt_pci.o
 obj-$(CONFIG_21285_WATCHDOG) += wdt285.o
Index: drivers/char/a2d_driver.c
diff -u /dev/null drivers/char/a2d_driver.c:1.1.2.4
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/char/a2d_driver.c	Thu Apr 24 06:46:31 2003
@@ -0,0 +1,280 @@
+
+#ifdef MODVERSIONS
+#include <linux/modversions.h>
+#endif
+
+#include <linux/module.h>
+#include <linux/errno.h>
+#include <linux/devfs_fs_kernel.h>
+
+#include <asm/io.h>
+#include <asm/uaccess.h>
+#include <linux/ts_sbc.h>
+
+#include "a2d_driver.h"
+
+/* Todo:
+ * Make ugly section of code into beautiful
+ * support asynchronous operations
+ */
+
+#define A2D_DEVICE_ERROR 0x5000
+	//the device can never return the upper 4 bits set to 0101
+
+struct a2d_info_s {
+	unsigned char channelno;
+	unsigned char polar_mode ; /* false: unipolar 
+				      true : bipolar
+				       */
+	unsigned char range; /* true: Range1 (5v range)
+				false: Range2 (10v range)
+				*/
+	signed int data;
+	char error;
+	struct semaphore sem;
+};
+
+static devfs_handle_t dev_parent;
+static struct a2d_info_s a2d_info[CHANNELS_MAX];
+
+static int fop_open (struct inode * inode, struct file * filep){
+	int channelno = MINOR(inode->i_rdev) - 1;
+
+	MOD_INC_USE_COUNT;
+
+	if (channelno >= CHANNELS_MAX) 
+		return -ENODEV; 
+	return 0;
+}
+
+static int fop_close (struct inode *inode, struct file *filep) {
+	MOD_DEC_USE_COUNT;
+	return 0;
+}
+
+int fop_ioctl ( struct inode *inode, struct file *filep,
+		unsigned int cmd, unsigned long arg)
+{
+	int channelno = MINOR(inode->i_rdev) - 1;
+	int user_a2dinfo;
+
+	if (channelno >= CHANNELS_MAX)
+		return -ENODEV;
+
+	switch (cmd)
+	{
+		case TSA2D_CONFIG:
+			a2d_info[channelno].polar_mode = arg & A2D_BIPOLAR; 
+				//if not set, then unipolar
+			a2d_info[channelno].range = arg & A2D_RANGE2; 
+				//if not set, then range1
+			break;
+		case TSA2D_SHOWCONFIG:
+			user_a2dinfo = 0;
+			user_a2dinfo |= a2d_info[channelno].polar_mode 
+				| a2d_info[channelno].range ;
+			return user_a2dinfo;
+			break;
+		default:
+			return -EINVAL;
+			break;
+	};
+
+	return 0;
+}
+
+static loff_t fop_nollseek (struct file *filep, loff_t offset, int whence) 
+{
+	return -ESPIPE;
+}
+
+static ssize_t fop_read (struct file *filep, char *buf, 
+		size_t count, loff_t *ppos)
+{
+	int channelno;
+	int ret;
+	int len = sizeof(a2d_info[channelno].data);
+	unsigned long res;
+
+	ret = 0;
+	channelno = MINOR(filep->f_dentry->d_inode->i_rdev) - 1;
+	if (channelno >= CHANNELS_MAX) 
+		return -ENODEV; 
+	
+	if (*ppos < 0) 
+		return -EINVAL;
+	if (count <= 0)
+		return 0;
+
+	if (a2d_info[channelno].data == A2D_DEVICE_ERROR)
+			return -EIO;
+
+	if ( down_interruptible ( &a2d_info[channelno].sem) )
+		return -ERESTARTSYS ;
+
+	if ( len > *ppos) {
+		len -= *ppos ;
+		if (len > count)
+			len = count;
+		ret = len;
+		res = copy_to_user(buf, &a2d_info[channelno].data, len);
+		if ( res != 0) 
+			ret = -EFAULT;
+		else
+			*ppos +=len;
+	}
+
+	up (&a2d_info[channelno].sem);
+	return ret;
+}
+
+static signed int a2d_convert (unsigned char command) {
+	int status; 
+	signed int result; 
+	int lsb, msb;
+	char i = 0;
+
+	outb(command, A2D_PORT);
+	/* Damn this is ugly */
+	status = inb(A2D_BUSY_PORT);
+	while ( (status & A2D_BUSY_BIT) != 0 && i < 50) {
+		status = inb(A2D_BUSY_PORT);
+		i++ ;
+	}
+	if ( i >= 50) {
+		//timeout, conversion never finished
+		printk("a2d_driver.o: TIMEOUT READING A2D DEVICE\n");
+		printk("status was 0x%x\n", status);
+		return A2D_DEVICE_ERROR;
+	}
+	lsb = inb(A2D_PORT);
+	msb = inb(A2D_PORT + 1);
+	result = (msb << 8) | lsb;
+
+	return result;
+	
+}
+
+
+static ssize_t fop_write (struct file *filep, const char * buff, size_t count, loff_t *ppos)
+{
+	int channelno;
+	char command =  0;
+
+	channelno = MINOR(filep->f_dentry->d_inode->i_rdev) - 1;
+
+	if (channelno >= CHANNELS_MAX) 
+		return -ENODEV; 
+
+	/* only one write should be serviced at a time
+	 * as they invoke a conversion request and 
+	 * change value of a2d_info[i].data
+	 */
+	if ( down_interruptible ( &a2d_info[channelno].sem) )
+		return -ERESTARTSYS ;
+	
+	command = channelno | a2d_info[channelno].polar_mode
+		| a2d_info[channelno].range;
+	a2d_info[channelno].data = a2d_convert(command);
+
+	*ppos = 0;
+	up ( &a2d_info[channelno].sem);
+
+	if (a2d_info[channelno].data == A2D_DEVICE_ERROR)
+			return -EIO;
+	
+	/* We only care that a write took place.
+	 * We don't care what was written, so
+	 * just signal that all data was recieved
+	 */
+	
+	return count ;
+}
+
+struct file_operations a2d_fops = {
+	owner: 	THIS_MODULE, 	//2.4.x compliant only
+	llseek: fop_nollseek,
+	read: 	fop_read ,
+	write:	fop_write ,
+	open:	fop_open ,
+	release:fop_close ,
+	ioctl:	fop_ioctl, 
+};
+
+int a2d_register () {
+	int i;
+	char name[4];
+	
+	dev_parent = devfs_mk_dir(NULL, "AtoD", NULL);
+	
+	for (i =0; i < CHANNELS_MAX; i++) {
+		sprintf (name, "%i", i);
+		devfs_register ( dev_parent, name, 
+			DEVFS_FL_DEFAULT | DEVFS_FL_AUTO_DEVNUM ,
+			0, 0, S_IFCHR | S_IRUGO | S_IWUGO, &a2d_fops, 0);
+	}
+		
+	return 0;
+}
+
+void a2d_remove () {
+	devfs_handle_t de;
+	int i;
+	char name[4];
+	
+	if (MOD_IN_USE) {
+		printk( KERN_WARNING "module in use, removal refused\n");
+		return ;
+	}
+
+	for (i = 0; i< CHANNELS_MAX; i++) {
+		sprintf (name, "%i", i);
+		de = devfs_find_handle (dev_parent, name, 
+				0,0,DEVFS_SPECIAL_CHR,0);
+		devfs_unregister (de); /* if null, this function
+					  should do nothing */
+	}
+
+	devfs_unregister(dev_parent);
+}
+
+int a2d_init () {
+	int result, i;
+	struct sbc_info *sbc;
+
+	/*check that A2D is installed in PLD*/
+	sbc = get_sbcinfo ();
+	if ( !sbc->AtoD) {
+		printk ( KERN_WARNING "a2d.o: AtoD option not installed\n");
+		remove_sbcinfo (sbc);
+		return -1;
+	} else
+		remove_sbcinfo (sbc);
+
+	for (i = 0; i < CHANNELS_MAX; i++) {
+		a2d_info[i].channelno = i;
+		a2d_info[i].polar_mode = 0;
+		a2d_info[i].range = 0;
+		a2d_info[i].data = 0;
+		sema_init(&a2d_info[i].sem, 1);
+	}
+
+	result = a2d_register ();
+
+	if ( result < 0 ) {
+		return result;
+	}
+
+
+	printk (KERN_NOTICE "a2d.o: Technologic Systems %s\n", A2D_VER);
+	printk ( KERN_NOTICE "a2d.o: Module Loaded\n");
+	return 0;
+}
+
+module_init (a2d_init);
+module_exit (a2d_remove);
+
+MODULE_AUTHOR("Liberty Young; Technologic Systems");
+MODULE_LICENSE("Dual MPL/GPL");
+MODULE_DESCRIPTION("Driver for TS SBCs with a Maxim 197 AtoD converter");
+MODULE_SUPPORTED_DEVICE("Technologic Systems SBC with AtoD");
Index: drivers/char/a2d_driver.h
diff -u /dev/null drivers/char/a2d_driver.h:1.1.2.1
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/char/a2d_driver.h	Mon Dec 16 04:10:59 2002
@@ -0,0 +1,43 @@
+/* a2d_driver.h
+ * Technologic Systems
+ * Liberty Young	Liberty/at/embeddedx86/dot/com
+ * 12.5.2002
+ *
+ * This driver is for any 3x00, 5x00 series Single Board Computers
+ * with the Analog to Digital option installed in the PLD and using 
+ * the MAXIM 197 AtoD chip. 
+ *
+ * No warranty is implied, or given, with this device driver.
+ */
+#define A2D_PORT  	0x196
+
+#ifdef CONFIG_TS_M386
+# 	define A2D_BUSY_PORT 	0xF860
+#	define A2D_BUSY_BIT	0x20
+#elif CONFIG_TS_M486
+#	define A2D_BUSY_PORT	0x195
+#	define A2D_BUSY_BIT	0x01
+#endif
+
+#define CHANNELS_MAX	8 /* 0 TO 7 channels on device */
+#define A2D_VER "12.8.2002 Ver 1.02"
+
+#define A2D_MAJOR 242
+/* Control bits of a2d command
+ * bits 0-2 	selected channel (0 - 7)
+ * bits 3	uni/bipolar ( 0 = unipolar (ie 0 to +5V)
+ * 			    ( 1 = bipolar (ie -5 to +5V)
+ * bit 4	selected range (0 = 5v range , 1 = 10V range)
+ * bit 5-7 	padded zero (unused)
+ */
+
+#define A2D_BIPOLAR 0x08
+#define A2D_UNIPOLAR 0x00
+#define A2D_RANGE1  0x00 //0 TO 5V range
+#define A2D_RANGE2  0x10 //0 TO 10V range
+
+#define A2D_MAGICNUM 0xD1
+#define TSA2D_CONFIG  _IOW(A2D_MAGICNUM, 1, int)
+#define TSA2D_SHOWCONFIG _IOR(A2D_MAGICNUM, 2, int)
+
+
Index: drivers/char/auto485.c
diff -u /dev/null drivers/char/auto485.c:1.1.2.2
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/char/auto485.c	Thu Dec 26 05:05:15 2002
@@ -0,0 +1,197 @@
+#include <linux/config.h>
+#include <linux/ts_sbc.h>
+#include <asm/termios.h>
+#include <linux/serialP.h>
+#include <asm/io.h>
+
+/*
+ * Liberty Young	Technologic Systems
+ * 11/02	
+ * auto485.c	(de)Set RTS mode of the Single Board Computer
+ * 		(de)Set auto485 mode of the Single Board Computer
+ */
+
+extern int tty_get_baud_rate(struct tty_struct *tty);
+
+static void disable_rtsmode ( void ) {
+	unsigned char portval;
+	portval = inb(0x75);
+	portval &= 0xBF; 
+	outb(portval, 0x75);
+}
+
+static void enable_rtsmode ( void) {
+	unsigned char portval;
+	portval = inb(0x75);
+	portval |= 0x40;
+	outb(portval, 0x75);
+}
+
+static void disable_auto485( void ) {
+	unsigned char portval;
+
+	portval = inb(0x75);
+	portval &= 0x7F; 
+	outb(portval, 0x75);
+}
+
+//note: we could use roundf here with C99 compliant compilers
+//but instead, we've opted not to deal with the extra code size
+static int ugly_roundf (float x) {
+	float temp;
+	temp =x ;
+	temp = temp + 0.5;
+	return (int)temp;
+}
+
+static int enable_auto485 ( unsigned int board_id, unsigned int datalength, int baud, int port) {
+	float timervalue;
+	unsigned char portval;
+	struct tv_sigbits {
+		u8 lsb;
+		u8 msb;
+	};
+	union uTV {
+		struct tv_sigbits sigbit;
+		u16 TV;
+	} loadvalue;
+	
+	//now we have to check for a Baud rate of no less than 9600 and no more than 115200
+	if ( (baud < 9600) || (baud > 115200) ) {
+		printk("serial.c: BaudRates less than 9600\n");
+		printk("or greater than 115200 are not allowed\n");
+		return -1;
+	}
+	if (board_id == 5300) {
+		if (port != 0x3F8) {
+			printk("auto485.c: this board only supports RS485 on COM1\n");
+			return -1;
+		}
+		timervalue = (115200.0 / baud) * 2.0;
+	
+		loadvalue.TV = ugly_roundf(timervalue); 
+		printk("loadvalue = %d\n", loadvalue.TV);
+		printk("loadvalue LSB is 0x%02x\n", loadvalue.sigbit.lsb);
+		printk("loadvalue MSB is 0x%02x\n", loadvalue.sigbit.msb);
+		
+		portval = inb(0x61);	
+		portval |= 0x03;
+		outb(portval, 0x61);
+		printk("write to I/O 0x61 value 0x%02x\n", portval);
+
+		outb(0xB6, 0x43); /* Timer2 into 'square mode' */
+		outb(loadvalue.sigbit.lsb, 0x42);
+		outb(loadvalue.sigbit.msb, 0x42);
+
+		if (datalength == 9){
+			printk("writing 0xC0 to I/O 75h\n");
+			outb(0xC0, 0x75);
+		}
+		if (datalength == 8){
+			printk("writing 0x80 to I/O 75h\n");
+			outb(0x80, 0x75);
+		}
+	}
+
+	if (board_id == 5400){
+		if (port != 0x3F8) {
+			printk("auto485.c: this board only supports RS485 on COM1\n");
+			return -1;
+		}
+		timervalue =  ((((115200.0 / baud) * 3200.0) / 31) - 3);
+		loadvalue.TV = ugly_roundf(timervalue); 
+		
+		printk("loadvalue = %d\n", loadvalue.TV);
+		printk("loadvalue LSB is 0x%02x\n", loadvalue.sigbit.lsb);
+		printk("loadvalue MSB is 0x%02x\n", loadvalue.sigbit.msb);
+		
+		portval = inb(0x61);	
+		portval |= 0x02;
+		portval &= 0xFE;
+		outb(portval, 0x61);
+
+
+		outb(0xB2, 0x43); /* Timer2 into 'one-shot' mode  */
+		outb(loadvalue.sigbit.lsb, 0x42);
+		outb(loadvalue.sigbit.msb, 0x42);
+		
+		if (datalength == 9)
+			outb(0xC0, 0x75);
+		if (datalength == 8)
+			outb(0x80, 0x75);
+
+	}
+	if (board_id == 5500){
+		if (port != 0x3E8) {
+			printk("auto485.c: this board only supports RS485 on COM3\n");
+			return -1;
+		}
+		if (datalength == 9)
+			outb(0xC0, 0x75);
+		if (datalength == 8)
+			outb(0x80, 0x75);
+	}
+
+	return 0;
+}
+
+int sbc_serial_modes ( struct async_struct *info, unsigned int cmd, 
+		unsigned int *value) 
+{
+	struct sbc_info *sbc;
+	int error;
+	unsigned int arg, datalength ;
+	int baud, cflag;
+	
+	error = 0;
+	sbc = get_sbcinfo();
+	arg = *value;
+	//is this operation even permissable?
+	if (!sbc->auto485){
+		remove_sbcinfo (sbc);
+		printk("serial.c: Sorry, this board does not support auto485\n");
+		printk("check /proc/SBC/info for features supported\n");
+		return -1; //this should be an actual errno
+	}
+	switch (cmd) {
+		case TIOC_SBCC485: 
+			if (arg & AUTO485){
+				printk("disableing auto485\n");
+				disable_auto485();
+			}
+			if (arg & RTSMODE){
+				printk("disableing rts mode\n");
+				disable_rtsmode () ;
+			}
+			break;
+		case TIOC_SBCS485:
+			if ( arg & AUTO485) {
+				cflag = info->tty->termios->c_cflag;
+				baud = tty_get_baud_rate (info->tty);
+				printk("SETTING auto485\n");
+
+				if (!(cflag & CS8)){
+					printk("auto485.c: Currently only handles CS8\n");
+					return -1;
+				}
+				datalength = 8;
+				if ( cflag & PARENB)
+					datalength = datalength + 1;
+
+				printk("cflag & PARENB:%d\n", cflag & PARENB);	
+				error = enable_auto485 ( sbc->board_id,
+						datalength, baud, info->port); 
+			}
+			if (arg & RTSMODE) {
+				printk("setting rts mode\n");
+				enable_rtsmode();
+			}
+			break;
+	}
+
+	remove_sbcinfo (sbc);
+	return error;
+}
+
+
+
Index: drivers/char/pc_keyb.c
diff -u drivers/char/pc_keyb.c:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/char/pc_keyb.c:1.1.1.1.2.1
--- drivers/char/pc_keyb.c:1.1.1.1	Mon Dec 16 03:14:29 2002
+++ drivers/char/pc_keyb.c	Mon Dec 16 04:19:36 2002
@@ -484,7 +484,7 @@
 static unsigned char handle_kbd_event(void)
 {
 	unsigned char status = kbd_read_status();
-	unsigned int work = 10000;
+	unsigned int work = 100;
 
 	while ((--work > 0) && (status & KBD_STAT_OBF)) {
 		unsigned char scancode;
@@ -506,9 +506,11 @@
 
 		status = kbd_read_status();
 	}
-		
+#ifndef TSYSTEMS		
 	if (!work)
-		printk(KERN_ERR "pc_keyb: controller jammed (0x%02X).\n", status);
+		printk(KERN_ERR "pc_keyb: controller jammed (0x%02X).\n", status); 
+#endif 
+	
 
 	return status;
 }
Index: drivers/char/serial.c
diff -u drivers/char/serial.c:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/char/serial.c:1.1.1.1.2.1
--- drivers/char/serial.c:1.1.1.1	Mon Dec 16 03:14:27 2002
+++ drivers/char/serial.c	Mon Dec 16 04:15:52 2002
@@ -57,9 +57,13 @@
  * 10/00: add in optional software flow control for serial console.
  *	  Kanoj Sarcar <kanoj@sgi.com>  (Modified by Theodore Ts'o)
  *
+ * 11/02: (unofficial) added in option to control Technologic Systems
+ * 	  Single Board Computers' auto485 mode and RTS mode on/off
+ * 	  Liberty Young <liberty/AT/embeddedx86/dot/com>
+ *
  */
 
-static char *serial_version = "5.05c";
+static char *serial_version = "5.05c-TS";
 static char *serial_revdate = "2001-07-08";
 
 /*
@@ -261,6 +265,11 @@
 /* number of characters left in xmit buffer before we ask for more */
 #define WAKEUP_CHARS 256
 
+#ifdef TSYSTEMS
+extern int sbc_serial_modes (struct async_struct *info, unsigned int cmd, unsigned *value);
+#endif
+
+
 /*
  * IRQ_timeout		- How long the timeout should be for each IRQ
  * 				should be after the IRQ has been active.
@@ -2687,7 +2696,9 @@
 			/* "setserial -W" is called in Debian boot */
 			printk ("TIOCSER?WILD ioctl obsolete, ignored.\n");
 			return 0;
-
+		case TIOC_SBCC485:
+		case TIOC_SBCS485:
+		      return sbc_serial_modes (info,cmd,(unsigned int *)arg);
 		default:
 			return -ENOIOCTLCMD;
 		}
Index: drivers/char/ts_486wdt.c
diff -u /dev/null drivers/char/ts_486wdt.c:1.1.2.1
--- /dev/null	Fri May 16 09:07:13 2003
+++ drivers/char/ts_486wdt.c	Mon Dec 16 04:30:37 2002
@@ -0,0 +1,176 @@
+/*
+ * AMD ELAN SC520 Watch Dog Timer Driver 
+ * (c) Technologic Systems (info@embeddedx86.com)
+ *      author: Liberty Young (liberty@embeddedx86.com)
+ *      
+ * Technologic Systems does not admit any liability nor any warranty for 
+ * this software or any of its use(s). This software is provided AS-IS. 
+ *
+ * 
+ * Version: 0.1.0	December 2001
+ * 	L.Y.	Initial Version
+ *
+ * This code is processor specific. It only works for the AMD Elan SC520 
+ * on-chip Watchdog Timer 
+ * and was developed for use in the Technologic Systems' Elan based Single 
+ * Board Computers
+ *
+ * Portions of this code is based off the W83877F Computer Watchdog Timer 
+ * driver by Scott Jennings
+ */
+
+#ifdef MODVERSIONS
+#include <linux/modversions.h>
+#endif
+
+#include <linux/module.h>
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/devfs_fs_kernel.h>
+#include <asm/io.h>
+
+#include "ts_486wdt.h"
+
+#define LOG_LEVEL KERN_INFO
+
+static unsigned long wdtmrctl;
+
+static int sc520_wdt_ping (void ) 
+{
+	writew (WDT_RESET_KEYSEQ1, (unsigned long) wdtmrctl) ;
+	writew (WDT_RESET_KEYSEQ2, (unsigned long) wdtmrctl) ;
+
+	dprintk("WDT was written to\n");
+	
+	return 1;
+}
+
+
+
+static void sc520_wdt_startup (unsigned long enable)
+{
+
+	union sc520_wdtmrctl_reg wdtregister;
+	wdtregister.wdtmrctl.wdt_ctl = 0XD0;
+
+	if (enable >= 1)
+		wdtregister.wdtmrctl.exp_timeout = (unsigned int) enable;
+	else
+		wdtregister.wdtmrctl.exp_timeout = 0x10;
+	
+	writew ( WDT_EN_KEYSEQ1, (unsigned long) wdtmrctl);
+	writew ( WDT_EN_KEYSEQ2, (unsigned long) wdtmrctl);
+ 	printk (LOG_LEVEL "\nAMD Elan SC520 WDT enable sequence\n");
+	
+	dprintk("\value of wdtmrctl_register: %x\n", wdtregister.wdtmrctl_reg);
+	
+	printk(LOG_LEVEL "\nAMD Elan SC520 WDT started with timeout of %xh \n",			wdtregister.wdtmrctl.exp_timeout);
+	writew (wdtregister.wdtmrctl_reg, (unsigned long) wdtmrctl);
+}
+
+
+/*
+ * /dev/watchdog handling
+ */
+
+static loff_t fop_nollseek (struct file * filep, loff_t offset, int whence)
+{
+	return -ESPIPE;
+}
+
+static ssize_t fop_read (struct file * filep, char * buf, size_t count, loff_t * ppos)
+{
+	return -EINVAL;
+}
+
+static ssize_t fop_write (struct file * filep, const char * buff, size_t count, loff_t *ppos)
+{
+	/*no seeking allowed!*/
+	if (ppos !=&filep->f_pos)
+		return -ESPIPE;
+
+	if (sc520_wdt_ping ())
+		return count;
+	else
+		return EIO;
+}
+
+
+static int fop_open (struct inode * inode, struct file * filep)
+{
+	return 0 ;	
+}
+
+
+
+int fop_ioctl (struct inode *inode, struct file *filep, 
+		unsigned int cmd, unsigned long arg)
+{
+	switch (cmd)
+	{
+		case WDT_PING:
+			if (sc520_wdt_ping())
+				return 0;
+			else
+				return  EIO;
+			break;
+		case WDT_BEGIN:		
+			sc520_wdt_startup(arg);
+			return 0;
+			break;
+		default:
+			return -EINVAL;
+			break;
+	};
+}
+
+struct file_operations sc520_wdt_fops = {
+	/* tagged interface is NOT C compliant; GNU specific */
+	
+	owner: THIS_MODULE,	//2.4.x compliant onl
+	llseek: fop_nollseek,
+	read:	fop_read,
+	write:	fop_write,
+	open: 	fop_open,
+	ioctl:	fop_ioctl,		
+};
+
+int init_module () {
+#ifdef CONFIG_DEVFS_FS
+	if (devfs_register (NULL, "amdwdt", DEVFS_FL_AUTO_DEVNUM, WDT_MAJOR,0,
+			S_IFCHR | S_IRUGO | S_IWUGO, &sc520_wdt_fops, 0) < 0) {
+#else
+	if ( register_chrdev ( WDT_MAJOR, "AMD Elan SC520 WatchDogTimer", 
+				&sc520_wdt_fops) <  0) {
+#endif
+		printk( KERN_WARNING "AMD SC520 Watch Dog Timer failed to registration");
+		return -ENODEV ;
+	} else 
+		wdtmrctl = (unsigned long) ioremap (SC520_WDTMRCTL, sizeof(union sc520_wdtmrctl_reg) );
+
+	printk (LOG_LEVEL "AMD Elan SC520 WatchDogTimer Module loaded\n") ;
+	return 0;
+
+
+}
+
+
+void cleanup_module () {
+#ifdef CONFIG_DEVFS_FS
+	devfs_handle_t de;
+	de = devfs_find_handle (NULL, "amdwdt", 0,0,DEVFS_SPECIAL_CHR,0);
+	devfs_unregister (de);
+#else
+	unregister_chrdev ( WDT_MAJOR, "AMD_SC520_WDT");
+#endif
+	iounmap((void *) wdtmrctl);
+	printk(LOG_LEVEL "WDT module was removed.");
+}
+
+
+
+
Index: drivers/char/ts_486wdt.h
diff -u /dev/null drivers/char/ts_486wdt.h:1.1.2.1
--- /dev/null	Fri May 16 09:07:14 2003
+++ drivers/char/ts_486wdt.h	Mon Dec 16 04:30:37 2002
@@ -0,0 +1,68 @@
+/***********************************************
+ * Technologic Systems	Liberty Young
+ *
+ * This driver only works with linux kernel 2.4.18 or compatible
+ * and only implements the basic features of the AMD SC520 Elan's WDT.
+ * Those features are starting the WDT with a user specified timeout,
+ * and reseting the WDT's counter. Of course, should the counter never
+ * be reseted, the Microprocessor its self will cause a hardware reset.
+ * Advanced features such as an interrupt timeout, of the "soft" timeout,
+ * are not supported.
+ * Though those features kinda defeat the purpose of a WD in an embedded 
+ * system :)
+ *
+ * Time Out Value
+ * A simple equation for figuring out the timeout value is as follows
+ * (from the AMD Elans user's manual):
+ * Duration = 2 ^ (timeout value) / (33 MHz crystal frequency)
+ *
+ * Dec 2001	Created
+ * Nov 2002	Slight modifications
+ *
+ */
+
+
+#define SC520_WDTMRCTL 	0XDFCB0
+#define SC520_WDT_MAGICNUM 0x57		//"W" 
+#define WDT_MAJOR	30
+
+#define WDT_PING  _IOW(SC520_WDT_MAGICNUM, 6, int)
+
+#define WDT_BEGIN	_IO(SC520_WDT_MAGICNUM,0)
+
+#ifdef DEBUG
+#define dprintk(x...) printk(## x)
+#else
+#define dprintk(x...)
+#endif
+
+#define WDT_EN_KEYSEQ1 0x3333
+#define WDT_EN_KEYSEQ2 0XCCCC
+
+#define WDT_RESET_KEYSEQ1 0XAAAA
+#define WDT_RESET_KEYSEQ2 0X5555
+
+/* the WDT's MRCTL register*/
+struct  sc520_wdtmrctl_def {
+	__u8 exp_timeout ;	//exponential timeout
+  	__u8 wdt_ctl ;		//bits that control and set Watchdog timer
+	
+};
+
+union sc520_wdtmrctl_reg {
+	struct sc520_wdtmrctl_def wdtmrctl;
+  	__u16 wdtmrctl_reg;
+};
+
+
+/* the WDT's Count Low register*/
+struct sc520_wdtmrcntl_reg {
+  	__u16 wdt_cntrl ;
+};
+
+/* the WDT's Count High Register*/
+struct sc520_wdtmrcnth_reg {
+	  __u16 wdt_cntrh ;
+};
+
+
Index: drivers/misc/Makefile
diff -u drivers/misc/Makefile:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/drivers/misc/Makefile:1.1.1.1.2.1
--- drivers/misc/Makefile:1.1.1.1	Mon Dec 16 03:14:36 2002
+++ drivers/misc/Makefile	Mon Dec 16 04:43:29 2002
@@ -11,6 +11,9 @@
 
 O_TARGET := misc.o
 
+obj-y	:= ts_sbcinfo.o
+export-objs := ts_sbcinfo.o
+
 include $(TOPDIR)/Rules.make
 
 fastdep:
Index: drivers/misc/ts_sbcinfo.c
diff -u /dev/null drivers/misc/ts_sbcinfo.c:1.1.2.4
--- /dev/null	Fri May 16 09:07:14 2003
+++ drivers/misc/ts_sbcinfo.c	Wed Jan 22 08:55:14 2003
@@ -0,0 +1,283 @@
+/*
+ * ts_sbcinfo.c
+ * Liberty Young	Technologic Systems
+ * spam_filter(email): liberty(at)embeddedx86.com/dot/com
+ * These functions add proc entries to display information
+ * about the SingleBoardComputer
+*/
+
+#include <linux/module.h>
+#include <linux/modsetver.h>
+#include <linux/ioport.h>
+#include <linux/proc_fs.h>
+#include <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/ts_sbc.h>
+#include <asm/io.h>
+#include <errno.h>
+#include <stdio.h>
+	
+struct sbc_info ts_sbc;
+
+struct sbc_info *get_sbcinfo ( void ) {
+	struct sbc_info *info;
+	info = NULL;
+
+	info = kmalloc (sizeof(struct sbc_info), GFP_KERNEL);
+	if (!info)
+		return info;
+
+	memset (info, 0, sizeof(struct sbc_info));
+	*info = ts_sbc;
+	return info;
+}
+void remove_sbcinfo ( struct sbc_info *info)
+{
+	kfree (info);
+}
+
+void sbc_flipled ( int direction) { 
+	struct sbc_info *info;
+	unsigned int temp;
+	
+	info = get_sbcinfo();
+	if ( !info)
+		return;
+	switch (info->board_id) {
+		case TS5300:
+		case TS5400:
+		case TS5500:
+			//request region?
+			temp = inb(0x77);
+			temp &= 0x01; //bit 0 is LED bit
+			temp = ~temp & 0x01;
+			outb(temp, 0X77);
+		default:
+			break;
+	}
+
+	remove_sbcinfo (info);
+}
+
+
+EXPORT_SYMBOL(remove_sbcinfo);
+EXPORT_SYMBOL(get_sbcinfo);
+
+static int sbc_setinfo ( struct sbc_info *sbc){
+	unsigned int err, temp;
+	
+	memset( sbc, 0, sizeof(struct sbc_info));
+	err = check_region(0x74,4);
+	if (err < 0)
+		return err;
+	
+	request_region(0x74, 4, "TS-SBC");
+
+	temp = inb(IO_SBCID);
+	if (temp & 0x07) 	//first 3 bits are set?
+		temp &= 0x07;	//Then we have a 3x00 SBC
+		
+	switch (temp) {
+		case TS5400:
+			sbc->board_id = 5400;
+			break;
+		case TS5300:
+			sbc->board_id = 5300;
+			break;
+		case TS5500:
+			sbc->board_id = 5500;
+			break;
+		case TS3300:
+			sbc->board_id = 3300;
+			break;
+		case TS3200:
+			sbc->board_id = 3200;
+			break;
+		case TS3100:
+			sbc->board_id = 3100;
+		default:
+			sbc->board_id = 0;
+	}
+	//0x75 is Option Code I/O 
+	temp = inb(0x75);
+
+	//check for SRAM option
+	switch (sbc->board_id) {
+		case 5300:
+		case 3400:
+		case 3300:
+		case 3200:
+			if (temp & 0x01) 
+				sbc->sram = 1;
+			break;
+		default:
+			break;
+	}
+		
+	//Does board support Analog to Digital support?
+	switch (sbc->board_id) {
+		case 5500:
+		case 3300:
+			if (temp & 0x04)
+				sbc->AtoD = 1;
+			break;
+		default:
+			break;
+	}
+	
+	//Is board set up to do RS485 and auto485?
+	//only 5300(rev c), 5400, and 5500 can 
+	//at this point
+	switch ( sbc->board_id) {
+		case 5400:
+		case 5500:
+			if ( (temp & 0x02) == 0x02){
+				sbc->RS485 = 1;
+				sbc->auto485 = 1; //they just have it
+			}
+			break;
+		case 5300:
+			if ( (temp & 0x02) == 0x02)
+				sbc->RS485 = 1;
+
+			if (temp & 0x0A)
+				sbc->auto485 = 1;
+			break;
+		default:
+			sbc->auto485=0;
+			break;
+	}
+
+	/* 0x76 is another Option code */
+	temp = inb(0x76);
+	
+	//check for Industrial Temp
+	if (temp & 0x02)
+		sbc->industrial = 1;
+
+	//check for external reset pin
+	switch (sbc->board_id) {
+		case 3400:
+		case 5500:
+			if (temp & 0x01)
+				sbc->extrst = 1;
+			break;
+		default:
+			sbc->extrst = 0;
+	}
+
+	// 0x77 is Jumpers and LED...bits 1 - 7 are r/o
+	// bit 0 is r /w
+	// 5x00 only
+	
+	temp = inb(0x77);
+
+	switch (sbc->board_id){
+		case 5500:
+		case 5400:
+		case 5300:
+			sbc->jumpers = (temp & 0xFE); 
+			break;
+		default:
+			sbc->jumpers = 0;
+	}
+
+	release_region(0x74,4);
+
+	return 0;
+}
+
+static int sbc_read_proc(char *page, char **start, off_t off,
+		int count, int *eof, void *data)
+{
+	char jumpers [24];
+	int len = 0;
+	unsigned int temp;
+
+	len += sprintf(page + len, "Board ID:		TS-%d\n",
+			ts_sbc.board_id );
+	len += sprintf(page + len, "RS485:   		%s\n",
+			ts_sbc.RS485 ? "yes" : "no");
+	len += sprintf(page + len, "AnalogToDigital: 	%s\n",
+			ts_sbc.AtoD ? "yes" : "no");
+	len += sprintf(page + len, "Auto485:  		%s\n",
+			ts_sbc.auto485 ? "yes" : "no");
+	len += sprintf(page + len, "SRAM:   		%s\n",
+			ts_sbc.sram ? "yes" : "no");
+	len += sprintf(page + len, "External Reset:	%s\n",
+			ts_sbc.extrst ? "yes" : "no");
+
+	//Jumper reads are only 5x00
+	switch (ts_sbc.board_id) {
+		case TS5300:
+		case TS5400:
+		case TS5500:
+			request_region(0x77, 1, "TS-SBC");
+			temp = inb(0x77);
+			len += sprintf(page + len, "JPS: ");
+
+			if (temp & 0x02)
+				len += sprintf(page + len, "JP1 ");
+			if (temp & 0x04)
+				len += sprintf(page + len, "JP2 ");
+			if (temp & 0x08)
+				len += sprintf(page + len, "JP3 ");
+			if (temp & 0x10)
+				len += sprintf(page + len, "JP4 ");
+			if (temp & 0x20)
+				len += sprintf(page + len, "JP5 ");
+			if (temp & 0x80)
+				len += sprintf(page + len, "JP8");
+			len += sprintf(page +len, "\n");
+			break;
+		default:
+			break;
+	}
+			
+			
+	if (len <= off+count)
+		*eof = 1;
+	*start = page + off;
+	len -= off;
+	if (len > count)
+		len =count;
+	
+	return len;
+}
+
+static void sbc_remove_proc (struct proc_dir_entry *entry) {
+	remove_proc_entry (entry->name,
+			entry->parent);
+	entry = NULL;
+}
+
+static int init_sbc_proc( void ) {
+	struct proc_dir_entry *entry, *parent_dir ;
+	int err; 
+	
+	parent_dir = proc_mkdir("SBC", NULL);
+	if (parent_dir == NULL)
+		return -ENOMEM;
+
+	entry = create_proc_read_entry ("info", S_IRUGO, parent_dir, sbc_read_proc, 0);
+
+	if (entry == NULL) {
+		sbc_remove_proc (entry);
+		printk("ts_sbcinfo.c: unable to create proc entry SBC/info");
+		return -ENOMEM;
+	}
+
+	err = sbc_setinfo (&ts_sbc);
+	if (err < 0 ) {
+		sbc_remove_proc( entry);
+		sbc_remove_proc (parent_dir);
+		printk("ts_sbcinfo.c: Problems determing SBC information..Error %d\n",err);
+		return err;
+	}
+
+	return 0;
+}
+
+
+__initcall(init_sbc_proc);
+
Index: include/asm-i386/ioctls.h
diff -u include/asm-i386/ioctls.h:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/include/asm-i386/ioctls.h:1.1.1.1.2.1
--- include/asm-i386/ioctls.h:1.1.1.1	Mon Dec 16 03:15:49 2002
+++ include/asm-i386/ioctls.h	Mon Dec 16 04:17:54 2002
@@ -68,6 +68,9 @@
 #define TIOCGHAYESESP   0x545E  /* Get Hayes ESP configuration */
 #define TIOCSHAYESESP   0x545F  /* Set Hayes ESP configuration */
 
+#define TIOC_SBCC485	_IOW('T',0x70,int) /*TS SBC RTS/485 mode Clear */
+#define TIOC_SBCS485	_IOW('T',0x71, int) /*TS SBC RTS/485 mode Set */
+
 /* Used for packet mode */
 #define TIOCPKT_DATA		 0
 #define TIOCPKT_FLUSHREAD	 1
Index: include/asm-i386/timex.h
diff -u include/asm-i386/timex.h:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/include/asm-i386/timex.h:1.1.1.1.2.1
--- include/asm-i386/timex.h:1.1.1.1	Mon Dec 16 03:15:49 2002
+++ include/asm-i386/timex.h	Mon Dec 16 03:40:31 2002
@@ -11,6 +11,10 @@
 
 #ifdef CONFIG_MELAN
 #  define CLOCK_TICK_RATE 1189200 /* AMD Elan has different frequency! */
+#elif  CONFIG_TS_M386
+#  define CLOCK_TICK_RATE 1000000 /*Technologic Systems's 386EX SBCs have own frequency */
+#elif CONFIG_TS_M486
+#  define CLOCK_TICK_RATE 1192809 /* the Elan SC520 also has its own frequency*/
 #else
 #  define CLOCK_TICK_RATE 1193180 /* Underlying HZ */
 #endif
Index: include/linux/blk.h
diff -u include/linux/blk.h:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/include/linux/blk.h:1.1.1.1.2.1
--- include/linux/blk.h:1.1.1.1	Mon Dec 16 03:15:50 2002
+++ include/linux/blk.h	Mon May 12 07:07:23 2003
@@ -65,6 +65,10 @@
 extern int rd_prompt;		/* 1 = prompt for ramdisk, 0 = don't prompt */
 extern int rd_image_start;	/* starting block # of image */
 
+#ifdef CONFIG_BLK_DEV_MSYS_DOC
+extern int fl_init(void);
+#endif /* CONFIG_BLK_DEV_MSYS_DOC */
+
 #ifdef CONFIG_BLK_DEV_INITRD
 
 #define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */
Index: include/linux/major.h
diff -u include/linux/major.h:1.1.1.1 Linux/KernelWork/SourceTrees/Linux-2.4.18/include/linux/major.h:1.1.1.1.2.1
--- include/linux/major.h:1.1.1.1	Mon Dec 16 03:15:50 2002
+++ include/linux/major.h	Mon May 12 07:07:23 2003
@@ -136,6 +136,8 @@
 
 #define JSFD_MAJOR	99
 
+#define FLASH_MAJOR	100	/* /dev/msys/fl... */
+
 #define PHONE_MAJOR	100
 
 #define LVM_CHAR_MAJOR	109	/* Logical Volume Manager */
Index: include/linux/ts_sbc.h
diff -u /dev/null include/linux/ts_sbc.h:1.1.2.3
--- /dev/null	Fri May 16 09:07:15 2003
+++ include/linux/ts_sbc.h	Wed Jan 22 08:55:14 2003
@@ -0,0 +1,39 @@
+/*
+ * ts_sbc.h
+ * Liberty Young	Technologic Systems
+ * spam_filter(email): liberty(at)embeddedx86.com/dot/com
+*/
+
+#define TS5300	0x50
+#define TS5400  0x40
+#define TS5500  0x60
+#define TS3400  4
+#define TS3300  3
+#define TS3200  2
+#define TS3100  1
+#define IO_SBCID 0x74
+
+
+#ifndef TSYSTEMS
+# error	"compilation without -DTSYSTEMS (or the like)"
+#endif
+
+
+#define AUTO485 1
+#define RTSMODE 2
+/*describes the SBC and Options installed*/
+struct sbc_info {
+	int  board_id;
+	char RS485;
+	char AtoD;
+	char RS422;
+	char Ethernet;
+	char auto485;
+	char extrst; 	//external reset
+	char sram; 	
+	char industrial;
+	char jumpers;
+};
+	
+extern struct sbc_info *get_sbcinfo (void ) ;
+extern void remove_sbcinfo (struct sbc_info *info);
