AliM1543C.cpp File Reference


Detailed Description

Contains the code for the emulated Ali M1543C chipset devices.

Id
AliM1543C.cpp,v 1.65 2008/03/14 15:30:50 iamcamiel Exp

X-1.64 Camiel Vanderhoeven 14-MAR-2008 1. More meaningful exceptions replace throwing (int) 1. 2. U64 macro replaces X64 macro.

X-1.63 Camiel Vanderhoeven 13-MAR-2008 Create init(), start_threads() and stop_threads() functions.

X-1.62 Camiel Vanderhoeven 11-MAR-2008 Named, debuggable mutexes.

X-1.61 Camiel Vanderhoeven 05-MAR-2008 Multi-threading version.

X-1.60 Brian Wheeler 27-FEB-2008 Avoid compiler warnings.

X-1.59 Camiel Vanderhoeven 26-FEB-2008 Moved DMA code into it's own class (CDMA)

X-1.58 Camiel Vanderhoeven 12-FEB-2008 Moved keyboard code into it's own class (CKeyboard)

X-1.57 Camiel Vanderhoeven 08-FEB-2008 Add more keyboard debugging.

X-1.56 Camiel Vanderhoeven 08-FEB-2008 Set default keyboard translation to scanset 3 (PS/2).

X-1.55 Camiel Vanderhoeven 07-FEB-2008 Add more keyboard debugging.

X-1.54 Camiel Vanderhoeven 07-FEB-2008 Don't define DEBUG_KBD by default.

X-1.53 Camiel Vanderhoeven 07-FEB-2008 Comments.

X-1.52 Brian Wheeler 02-FEB-2008 Completed LPT support so it works with FreeBSD as a guest OS.

X-1.51 Brian wheeler 15-JAN-2008 When a keyboard self-test command is received, and the queue is not empty, the queue is cleared so the 0x55 that's sent back will be the first thing in line. Makes the keyboard initialize a little better with SRM.

X-1.50 Camiel Vanderhoeven 08-JAN-2008 Comments.

X-1.49 Camiel Vanderhoeven 02-JAN-2008 Comments; moved keyboard status register bits to a "status" struct.

X-1.48 Camiel Vanderhoeven 30-DEC-2007 Print file id on initialization.

X-1.47 Camiel Vanderhoeven 30-DEC-2007 Comments.

X-1.46 Camiel Vanderhoeven 29-DEC-2007 Avoid referencing uninitialized data.

X-1.45 Camiel Vanderhoeven 28-DEC-2007 Throw exceptions rather than just exiting when errors occur.

X-1.44 Camiel Vanderhoeven 28-DEC-2007 Keep the compiler happy.

X-1.43 Camiel Vanderhoeven 19-DEC-2007 Commented out message on PIC de-assertion.

X-1.42 Brian wheeler 17-DEC-2007 Better DMA support.

X-1.41 Camiel Vanderhoeven 17-DEC-2007 SaveState file format 2.1

X-1.40 Brian Wheeler 11-DEC-2007 Improved timer logic (again).

X-1.39 Brian Wheeler 10-DEC-2007 Improved timer logic.

X-1.38 Camiel Vanderhoeven 10-DEC-2007 Added config item for vga_console.

X-1.37 Camiel Vanderhoeven 10-DEC-2007 Use configurator; move IDE and USB to their own classes.

X-1.36 Camiel Vanderhoeven 7-DEC-2007 Made keyboard messages conditional; add busmaster_status; add pic_edge_level.

X-1.35 Camiel Vanderhoeven 7-DEC-2007 Generate keyboard interrupts when needed.

X-1.34 Camiel Vanderhoeven 6-DEC-2007 Corrected bug regarding make/break key settings.

X-1.33 Camiel Vanderhoeven 6-DEC-2007 Changed keyboard implementation (with thanks to the Bochs project!!)

X-1.32 Brian Wheeler 2-DEC-2007 Timing / floppy tweak for Linux/BSD guests.

X-1.31 Brian Wheeler 1-DEC-2007 Added console support (using SDL library), corrected timer behavior for Linux/BSD as a guest OS.

X-1.30 Camiel Vanderhoeven 1-DEC-2007 Use correct interrupt for secondary IDE controller.

X-1.29 Camiel Vanderhoeven 17-NOV-2007 Use CHECK_ALLOCATION.

X-1.28 Eduardo Marcelo Serrat 31-OCT-2007 Corrected IDE interface revision level.

X-1.27 Camiel Vanderhoeven 18-APR-2007 On a big-endian system, the LBA address for a read or write action was byte-swapped. Fixed this.

X-1.26 Camiel Vanderhoeven 17-APR-2007 Removed debugging messages.

X-1.25 Camiel Vanderhoeven 16-APR-2007 Added ResetPCI()

X-1.24 Camiel Vanderhoeven 11-APR-2007 Moved all data that should be saved to a state file to a structure "state".

X-1.23 Camiel Vanderhoeven 3-APR-2007 Fixed wrong IDE configuration mask (address ranges masked were too short, leading to overlapping memory regions.)

X-1.22 Camiel Vanderhoeven 1-APR-2007 Uncommented the IDE debugging statements.

X-1.21 Camiel Vanderhoeven 31-MAR-2007 Added old changelog comments.

X-1.20 Camiel Vanderhoeven 30-MAR-2007 Unintentional CVS commit / version number increase.

X-1.19 Camiel Vanderhoeven 27-MAR-2007 a) When DEBUG_PIC is defined, generate more debugging messages. b) When an interrupt originates from the cascaded interrupt controller, the interrupt vector from the cascaded controller is returned. c) When interrupts are ended on the cascaded controller, and no interrupts are left on that controller, the cascade interrupt (2) on the primary controller is ended as well. I'M NOT COMPLETELY SURE IF THIS IS CORRECT, but what goes on in OpenVMS seems to imply this. d) When the system state is saved to a vms file, and then restored, the ide_status may be 0xb9, this bug has not been found yet, but as a workaround, we detect the value 0xb9, and replace it with 0x40. e) Changed the values for cylinders/heads/sectors on the IDE identify command, because it looks like OpenVMS' DQDRIVER doesn't like it if the number of sectors is greater than 63. f) All IDE commands generate an interrupt upon completion. g) IDE command SET TRANSLATION (0x91) is recognized, but has no effect. This is allright, as long as OpenVMS NEVER DOES CHS-mode access to the disk.

X-1.18 Camiel Vanderhoeven 26-MAR-2007 a) Specific-EOI's (end-of-interrupt) now only end the interrupt they are meant for. b) When DEBUG_PIC is defined, debugging messages for the interrupt controllers are output to the console, same with DEBUG_IDE and the IDE controller. c) If IDE registers for a non-existing drive are read, 0xff is returned. d) Generate an interrupt when a sector is read or written from a disk.

X-1.17 Camiel Vanderhoeven 1-MAR-2007 a) Accesses to IDE-configuration space are byte-swapped on a big-endian architecture. This is done through the endian_bits macro. b) Access to the IDE databuffers (16-bit transfers) are byte-swapped on a big-endian architecture. This is done through the endian_16 macro.

X-1.16 Camiel Vanderhoeven 20-FEB-2007 Write sectors to disk when the IDE WRITE command (0x30) is executed.

X-1.15 Brian Wheeler 20-FEB-2007 Information about IDE disks is now kept in the ide_info structure.

X-1.14 Camiel Vanderhoeven 16-FEB-2007 a) This is now a slow-clocked device. b) Removed ifdef _WIN32 from printf statements.

X-1.13 Brian Wheeler 13-FEB-2007 Corrected some typecasts in printf statements.

X-1.12 Camiel Vanderhoeven 12-FEB-2007 Added comments.

X-1.11 Camiel Vanderhoeven 9-FEB-2007 Replaced f_ variables with ide_ members.

X-1.10 Camiel Vanderhoeven 9-FEB-2007 Only open an IDE disk image, if there is a filename.

X-1.9 Brian Wheeler 7-FEB-2007 Load disk images according to the configuration file.

X-1.8 Camiel Vanderhoeven 7-FEB-2007 a) Removed a lot of pointless messages. b) Calls to trace_dev now use the TRC_DEVx macro's.

X-1.7 Camiel Vanderhoeven 3-FEB-2007 Removed last conditional for supporting another system than an ES40 (ifdef DS15)

X-1.6 Brian Wheeler 3-FEB-2007 Formatting.

X-1.5 Brian Wheeler 3-FEB-2007 Fixed some problems with sprintf statements.

X-1.4 Brian Wheeler 3-FEB-2007 Space for 4 disks in f_img.

X-1.3 Brian Wheeler 3-FEB-2007 Scanf, printf and 64-bit literals made compatible with Linux/GCC/glibc.

X-1.2 Brian Wheeler 3-FEB-2007 Includes are now case-correct (necessary on Linux)

X-1.1 Camiel Vanderhoeven 19-JAN-2007 Initial version in CVS.

Definition in file AliM1543C.cpp.

#include "StdAfx.h"
#include "AliM1543C.h"
#include "System.h"
#include "VGA.h"

Go to the source code of this file.

Defines

#define IPus   847
#define PIT_FACTOR   5000
#define PIT_DEC(p)   p = (p < PIT_FACTOR ? 0 : p - PIT_FACTOR);
#define PIT_RATIO   1
#define PIC_STD   0
#define PIC_INIT_0   1
#define PIC_INIT_1   2
#define PIC_INIT_2   3
#define DEBUG_EXPR   (index != 0 || (intno != 0 && intno > 4))

Variables

u32 ali_cfg_data [64]
u32 ali_cfg_mask [64]
static u32 ali_magic1 = 0xA111543C
static u32 ali_magic2 = 0xC345111A
CAliM1543CtheAli = 0


Define Documentation

#define DEBUG_EXPR   (index != 0 || (intno != 0 && intno > 4))

Definition at line 1119 of file AliM1543C.cpp.

Referenced by CAliM1543C::pic_interrupt().

#define IPus   847

Definition at line 272 of file AliM1543C.cpp.

Referenced by CAliM1543C::toy_write().

#define PIC_INIT_0   1

Definition at line 943 of file AliM1543C.cpp.

Referenced by CAliM1543C::pic_write().

#define PIC_INIT_1   2

Definition at line 944 of file AliM1543C.cpp.

Referenced by CAliM1543C::pic_write().

#define PIC_INIT_2   3

Definition at line 945 of file AliM1543C.cpp.

Referenced by CAliM1543C::pic_write().

#define PIC_STD   0

Definition at line 942 of file AliM1543C.cpp.

Referenced by CAliM1543C::pic_write().

#define PIT_DEC (  )     p = (p < PIT_FACTOR ? 0 : p - PIT_FACTOR);

Definition at line 839 of file AliM1543C.cpp.

Referenced by CAliM1543C::pit_clock().

#define PIT_FACTOR   5000

Definition at line 838 of file AliM1543C.cpp.

#define PIT_RATIO   1

Definition at line 922 of file AliM1543C.cpp.

Referenced by CAliM1543C::do_pit_clock().


Variable Documentation

Initial value:

 {
   0x153310b9,  
   0x0200000f,  
   0x060100c3,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,
   0x00000000,  
  0, 0, 0, 0, 0,
   0x00000200,  
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 274 of file AliM1543C.cpp.

Referenced by CAliM1543C::init().

Initial value:

 {
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,  
   0x00000000,
   0x00000000,  
   0xffcfff7f,
   0xff00cbdf,
   0xffffffff,
   0x000000ff,
   0xffff8fff,
   0xf0ffff00,
   0x030f0d7f,
  0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
}

Definition at line 298 of file AliM1543C.cpp.

Referenced by CAliM1543C::init().

u32 ali_magic1 = 0xA111543C [static]

Definition at line 1182 of file AliM1543C.cpp.

Referenced by CAliM1543C::RestoreState(), and CAliM1543C::SaveState().

u32 ali_magic2 = 0xC345111A [static]

Definition at line 1183 of file AliM1543C.cpp.

Referenced by CAliM1543C::RestoreState(), and CAliM1543C::SaveState().


SourceForge.net Logo
Project space on SourceForge.net