* Code cleanup:

- remove trailing white space, trailing empty lines, C++ comments, etc.
  - split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)

* Patches by Kenneth Johansson, 25 Jun 2003:
  - major rework of command structure
    (work done mostly by Michal Cendrowski and Joakim Kristiansen)
This commit is contained in:
wdenk 2003-06-27 21:31:46 +00:00
parent 993cad9364
commit 8bde7f776c
1246 changed files with 46635 additions and 48962 deletions

View File

@ -1,11 +1,25 @@
======================================================================
Changes since U-Boot 0.3.1:
Changes since U-Boot 0.4.0:
======================================================================
* Code cleanup:
- remove trailing white space, trailing empty lines, C++ comments, etc.
- split cmd_boot.c (separate cmd_bdinfo.c and cmd_load.c)
* Patches by Kenneth Johansson, 25 Jun 2003:
- major rework of command structure
(work done mostly by Michal Cendrowski and Joakim Kristiansen)
======================================================================
Changes for U-Boot 0.4.0:
======================================================================
* Patches by Robert Schwebel, 26 Jun 2003:
- logdl
- csb226
- innokom
- csb226 configuration updated
- credits for logodl port updated
- innokom configuration updated
- logodl tree update, still with coding style inconsistencies
- added OCM for ppc405 warning to README
* Patch by Pantelis Antoniou, 25 Jun 2003:
update NetVia with V2 board support

View File

@ -134,7 +134,8 @@ u-boot.dis: u-boot
$(OBJDUMP) -d $< > $@
u-boot: depend subdirs $(OBJS) $(LIBS) $(LDSCRIPT)
$(LD) $(LDFLAGS) $(OBJS) \
UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) |sed -n -e 's/.*\(__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
$(LD) $(LDFLAGS) $$UNDEF_SYM $(OBJS) \
--start-group $(LIBS) --end-group \
-Map u-boot.map -o u-boot

9
README
View File

@ -1349,8 +1349,6 @@ Modem Support:
See also: doc/README.Modem
Configuration Settings:
-----------------------
@ -1842,7 +1840,6 @@ Note: for some board special configuration names may exist; check if
etc.
Finally, type "make all", and you should get some working U-Boot
images ready for downlod to / installation on your system:
@ -1906,7 +1903,6 @@ or to build on a native PowerPC system you can type
See also "U-Boot Porting Guide" below.
Monitor Commands - Overview:
============================
@ -2165,7 +2161,6 @@ o If neither SROM nor the environment contain a MAC address, an error
is raised.
Image Formats:
==============
@ -2428,7 +2423,6 @@ corruption happened:
Verifying Checksum ... OK
Boot Linux:
-----------
@ -2641,7 +2635,6 @@ Hit 'q':
[q, b, e, ?] ## Application terminated, rc = 0x0
Minicom warning:
================
@ -2813,7 +2806,6 @@ On ARM, the following registers are used:
==> U-Boot will use R8 to hold a pointer to the global data
Memory Management:
------------------
@ -2959,7 +2951,6 @@ void no_more_time (int sig)
}
Coding Standards:
-----------------

View File

@ -1,3 +1,4 @@
#######################################################################
#
# Copyright (C) 2000, 2001, 2002, 2003
@ -35,7 +36,7 @@ LIB = lib$(BOARD).a
OBJS = $(BOARD).o flash.o
$(LIB): .depend $(OBJS)
$(AR) crv $@ $^
$(AR) crv $@ $(OBJS)
#########################################################################

View File

@ -123,6 +123,10 @@ SECTIONS
_edata = .;
PROVIDE (edata = .);
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;

View File

@ -137,4 +137,3 @@ SECTIONS
_end = . ;
PROVIDE (end = .);
}

View File

@ -86,7 +86,6 @@ long initdram (int board_type)
}
void after_reloc (ulong dest_addr, gd_t *gd)
{
/* HJF: DECLARE_GLOBAL_DATA_PTR; */

View File

@ -134,7 +134,6 @@
#define ARTICIAS_ISAIO_PHYS 0xfe002000
/* Prototypes */
long articiaS_ram_init(void);
void articiaS_pci_init(void);

View File

@ -123,14 +123,14 @@ struct pci_irq_fixup_table fixuptab [] =
{
{ 0, 0, 0, 0xff}, /* Articia S host bridge */
{ 0, 1, 0, 0xff}, /* Articia S AGP bridge */
// { 0, 6, 0, 0x05}, /* 3COM ethernet */
/* { 0, 6, 0, 0x05}, /###* 3COM ethernet */
{ 0, 7, 0, 0xff}, /* VIA southbridge */
{ 0, 7, 1, 0x0e}, /* IDE controller in legacy mode */
// { 0, 7, 2, 0x05}, /* First USB controller */
// { 0, 7, 3, 0x0c}, /* Second USB controller (shares interrupt with ethernet) */
/* { 0, 7, 2, 0x05}, /###* First USB controller */
/* { 0, 7, 3, 0x0c}, /###* Second USB controller (shares interrupt with ethernet) */
{ 0, 7, 4, 0xff}, /* ACPI Power Management */
// { 0, 7, 5, 0x08}, /* AC97 */
// { 0, 7, 6, 0x08}, /* MC97 */
/* { 0, 7, 5, 0x08}, /###* AC97 */
/* { 0, 7, 6, 0x08}, /###* MC97 */
{ 0xff, 0xff, 0xff, 0xff}
};
@ -287,7 +287,7 @@ void articiaS_pci_init (void)
PRINTF("atriciaS_pci_init\n");
// Why aren't these relocated??
/* Why aren't these relocated?? */
for (i=0; config_table[i].config_device; i++)
{
switch((int)config_table[i].config_device)
@ -335,7 +335,6 @@ void articiaS_pci_init (void)
PCI_REGION_IO);
articiaS_hose.region_count = 4;
pci_setup_indirect(&articiaS_hose, ARTICIAS_PCI_CFGADDR, ARTICIAS_PCI_CFGDATA);
@ -410,8 +409,8 @@ pci_dev_t pci_hose_find_class(struct pci_controller *hose, int bus, short find_c
pci_hose_read_config_byte(hose, dev, 0x0B, &c1);
pci_hose_read_config_byte(hose, dev, 0x0A, &c2);
class = c1<<8 | c2;
//printf("At %02x:%02x:%02x: class %x\n",
// PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), class);
/*printf("At %02x:%02x:%02x: class %x\n", */
/* PCI_BUS(dev), PCI_DEV(dev), PCI_FUNC(dev), class); */
if (class == find_class)
{
if (index == 0)
@ -441,7 +440,7 @@ pci_dev_t pci_find_bridge_for_bus(struct pci_controller *hose, int busnr)
if (hose == NULL) hose = &articiaS_hose;
if (busnr < hose->first_busno || busnr > hose->last_busno) return PCI_ANY_ID; // Not in range
if (busnr < hose->first_busno || busnr > hose->last_busno) return PCI_ANY_ID; /* Not in range */
/*
* The bridge must be on a lower bus number
@ -467,7 +466,7 @@ pci_dev_t pci_find_bridge_for_bus(struct pci_controller *hose, int busnr)
if (!PCI_FUNC(dev))
found_multi = header_type & 0x80;
if (header_type == 1) // Bridge device header
if (header_type == 1) /* Bridge device header */
{
pci_hose_read_config_byte(hose, dev, PCI_SECONDARY_BUS, &secondary_bus);
if ((int)secondary_bus == busnr) return dev;

View File

@ -1,5 +1,4 @@
#include "macros.h"
#include "macros.h"
#define GLOBALINFO0 0x50

View File

@ -1,6 +1,5 @@
#include <common.h>
#include <command.h>
#include <cmd_boota.h>
#include "../disk/part_amiga.h"
#include <asm/cache.h>
@ -121,3 +120,10 @@ int do_boota (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
return 0;
}
#if defined(CONFIG_AMIGAONEG3SE) && (CONFIG_COMMANDS & CFG_CMD_BSP)
cmd_tbl_t U_BOOT_CMD(BOOTA) = MK_CMD_ENTRY(
"boota", 3, 1, do_boota,
"boota - boot an Amiga kernel\n",
"address disk"
);
#endif /* _CMD_BOOTA_H */

View File

@ -30,4 +30,3 @@ X86EMU = -I../bios_emulator/scitech/include -I../bios_emulator/scitech/src/x86e
TEXT_BASE = 0xfff00000
PLATFORM_CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE) -Wa,-mregnames -DEASTEREGG $(X86EMU) -Dprintk=printf #-DDEBUG

View File

@ -36,7 +36,7 @@
/* 3Com Ethernet PCI definitions*/
// #define PCI_VENDOR_ID_3COM 0x10B7
/* #define PCI_VENDOR_ID_3COM 0x10B7 */
#define PCI_DEVICE_ID_3COM_3C905C 0x9200
/* 3Com Commands, top 5 bits are command and bottom 11 bits are parameters */
@ -353,7 +353,7 @@ static int issue_and_wait(struct eth_device* dev, int command)
ETH_CMD(dev, command);
for (i = 0; i < 2000; i++) {
status = ETH_STATUS(dev);
//printf ("Issue: status 0x%4x.\n", status);
/*printf ("Issue: status 0x%4x.\n", status); */
if (!(status & CmdInProgress))
return 1;
}
@ -361,7 +361,7 @@ static int issue_and_wait(struct eth_device* dev, int command)
/* OK, that didn't work. Do it the slow way. One second */
for (i = 0; i < 100000; i++) {
status = ETH_STATUS(dev);
//printf ("Issue: status 0x%4x.\n", status);
/*printf ("Issue: status 0x%4x.\n", status); */
return 1;
udelay(10);
}
@ -378,7 +378,7 @@ static int auto_negotiate(struct eth_device* dev)
EL3WINDOW(dev, 1);
// Wait for Auto negotiation to complete
/* Wait for Auto negotiation to complete */
for (i = 0; i <= 1000; i++)
{
if (ETH_INW(dev, 2) & 0x04)
@ -393,7 +393,6 @@ static int auto_negotiate(struct eth_device* dev)
}
return 1;
}
@ -481,7 +480,7 @@ int eth_3com_initialize(bd_t *bis)
goto Done;
}
dev = (struct eth_device*) malloc(sizeof(*dev)); //struct eth_device));
dev = (struct eth_device*) malloc(sizeof(*dev)); /*struct eth_device)); */
sprintf(dev->name, "3Com 3c920c#%d", card_number);
dev->iobase = eth_iobase;
@ -583,7 +582,7 @@ static int eth_3com_init(struct eth_device* dev, bd_t *bis)
/* Below sets no bits are to cause an interrupt since this is just polling */
intr_enable = SetIntrEnb;
// intr_enable = SetIntrEnb | (1<<9) | (1<<10) | (1<<6);
/* intr_enable = SetIntrEnb | (1<<9) | (1<<10) | (1<<6); */
ETH_CMD(dev, intr_enable);
ETH_OUTB(dev, 127, UpPoll);
@ -758,8 +757,8 @@ void eth_3com_halt(struct eth_device* dev)
issue_and_wait(dev, RxDisable);
issue_and_wait(dev, TxDisable);
// free(tx_ring); /* release memory allocated to the DPD and UPD rings */
// free(rx_ring);
/* free(tx_ring); /###* release memory allocated to the DPD and UPD rings */
/* free(rx_ring); */
Done:
return;
@ -883,4 +882,3 @@ static void read_hw_addr(struct eth_device* dev, bd_t *bis)
Done:
return;
}

View File

@ -31,7 +31,6 @@
/*---------------------------------------------------------------------*/
#undef DEBUG_FLASH
//#define DEBUG_FLASH
#ifdef DEBUG_FLASH
#define DEBUGF(fmt,args...) printf(fmt ,##args)

View File

@ -75,16 +75,16 @@ void i8259_init(void)
char dummy;
PRINTF("Initializing Interrupt controller\n");
/* init master interrupt controller */
out8(0x20, 0x11); //0x19); // was: 0x11); /* Start init sequence */
out8(0x20, 0x11); /* 0x19); /###* Start init sequence */
out8(0x21, 0x00); /* Vector base */
out8(0x21, 0x04); /* edge tiggered, Cascade (slave) on IRQ2 */
out8(0x21, 0x11); // was: 0x01); /* Select 8086 mode */
out8(0x21, 0x11); /* was: 0x01); /###* Select 8086 mode */
/* init slave interrupt controller */
out8(0xA0, 0x11); //0x19); // was: 0x11); /* Start init sequence */
out8(0xA0, 0x11); /* 0x19); /###* Start init sequence */
out8(0xA1, 0x08); /* Vector base */
out8(0xA1, 0x02); /* edge triggered, Cascade (slave) on IRQ2 */
out8(0xA1, 0x11); // was: 0x01); /* Select 8086 mode */
out8(0xA1, 0x11); /* was: 0x01); /###* Select 8086 mode */
/* always read ISR */
out8(0x20, 0x0B);

View File

@ -167,8 +167,8 @@ external_interrupt(struct pt_regs *regs)
int irq, unmask = 1;
irq = i8259_irq(); //i8259_get_irq(regs);
// printf("irq = %d, handler at %p ack=%d\n", irq, irq_handlers[irq].handler, *(volatile unsigned char *)0xFEF00000);
irq = i8259_irq(); /*i8259_get_irq(regs); */
/* printf("irq = %d, handler at %p ack=%d\n", irq, irq_handlers[irq].handler, *(volatile unsigned char *)0xFEF00000); */
i8259_mask_and_ack(irq);
if (irq_handlers[irq].handler != NULL)
@ -264,5 +264,3 @@ do_irqinfo(cmd_tbl_t *cmdtp, bd_t *bd, int flag, int argc, char *argv[])
{
puts("IRQ related functions are unimplemented currently.\n");
}

View File

@ -1,7 +1,6 @@
#include "macros.h"
.globl pci_read_cfg_byte
pci_read_cfg_byte:
@ -13,7 +12,6 @@ pci_read_cfg_byte:
blr
.globl pci_write_cfg_byte
pci_write_cfg_byte:
@ -25,7 +23,6 @@ pci_write_cfg_byte:
blr
.globl pci_read_cfg_word
pci_read_cfg_word:
@ -37,7 +34,6 @@ pci_read_cfg_word:
blr
.globl pci_write_cfg_word
pci_write_cfg_word:
@ -49,7 +45,6 @@ pci_write_cfg_word:
blr
.globl pci_read_cfg_long
pci_read_cfg_long:
@ -61,7 +56,6 @@ pci_read_cfg_long:
blr
.globl pci_write_cfg_long
pci_write_cfg_long:
@ -71,4 +65,3 @@ pci_write_cfg_long:
eieio
sync
blr

View File

@ -34,4 +34,3 @@ void disable_nvram(void)
{
pci_write_cfg_byte(0, 0, 0x56, 0x0);
}

View File

@ -48,7 +48,6 @@ void i8259_unmask_irq(unsigned int irq);
#undef KBG_DEBUG
//#define KBG_DEBUG
#ifdef KBG_DEBUG
#define PRINTF(fmt,args...) printf (fmt ,##args)
@ -143,8 +142,6 @@ void i8259_unmask_irq(unsigned int irq);
#define KBD_BUFFER_LEN 0x20 /* size of the keyboardbuffer */
static volatile char kbd_buffer[KBD_BUFFER_LEN];
static volatile int in_pointer = 0;
static volatile int out_pointer = 0;
@ -494,7 +491,6 @@ unsigned char handle_kbd_event(void)
}
/******************************************************************************
* Lowlevel Part of keyboard section
*/
@ -692,8 +688,3 @@ void kbd_interrupt(void)
{
handle_kbd_event();
}
/* eof */

View File

@ -106,36 +106,36 @@ void sm_send_stop(void)
int sm_read_byte_from_device(uint8 addr, uint8 reg, uint8 *storage)
{
// S Addr Wr
/* S Addr Wr */
sm_write_mode();
sm_send_start();
sm_write_byte((addr<<1));
// [A]
/* [A] */
sm_read_mode();
if (sm_get_ack() == FALSE) return FALSE;
// Comm
/* Comm */
sm_write_mode();
sm_write_byte(reg);
// [A]
/* [A] */
sm_read_mode();
if (sm_get_ack() == FALSE) return FALSE;
// S Addr Rd
/* S Addr Rd */
sm_write_mode();
sm_send_start();
sm_write_byte((addr<<1)|1);
// [A]
/* [A] */
sm_read_mode();
if (sm_get_ack() == FALSE) return FALSE;
// [Data]
/* [Data] */
*storage = sm_read_byte();
// NA
/* NA */
sm_write_mode();
sm_write_nack();
sm_send_stop();

View File

@ -148,7 +148,6 @@
/*--------------------------------------------------------------*/
/*--------------------------------------------------------------*/
/* END TERON Articia / SDRAM Initialization code */
/*--------------------------------------------------------------*/
@ -197,5 +196,3 @@ write dmem 0xfee00cfc 0x00003280
write dmem 0xfec00cf8 0xc4000080
write dmem 0xfee00cfc 0x00003290

View File

@ -108,6 +108,11 @@ SECTIONS
_edata = .;
PROVIDE (edata = .);
__u_boot_cmd_start = .;
.u_boot_cmd : { *(.u_boot_cmd) }
__u_boot_cmd_end = .;
__start___ex_table = .;
__ex_table : { *(__ex_table) }
__stop___ex_table = .;

View File

@ -83,7 +83,7 @@
#define USB_MAX_TEMP_INT_TD 32 /* number of temporary TDs for Interrupt transfers */
//#define USB_UHCI_DEBUG
/*#define USB_UHCI_DEBUG */
#ifdef USB_UHCI_DEBUG
#define USB_UHCI_PRINTF(fmt,args...) printf (fmt ,##args)
@ -1115,7 +1115,6 @@ static void usb_display_wValue(unsigned short wValue,unsigned short wIndex)
#endif
#ifdef USB_UHCI_DEBUG
static int usb_display_td(uhci_td_t *td)

View File

@ -190,5 +190,3 @@ struct virt_root_hub {
#endif /* _USB_UHCI_H_ */

View File

@ -129,11 +129,11 @@ int drv_video_init(void)
int video_init(void)
{
cursor_position = VIDEO_BASE; // Color text display base
cursor_position = VIDEO_BASE; /* Color text display base */
cursor_row = 0;
cursor_col = 0;
current_attr = video_get_attr(); // Currently selected value for attribute.
// video_test();
current_attr = video_get_attr(); /* Currently selected value for attribute. */
/* video_test(); */
video_set_color(current_attr);
return 0;
@ -328,7 +328,7 @@ void video_draw_box(int style, int attr, char *title, int separate, int x, int y
*(fb2+1) = attr; fb2 += 2*VIDEO_COLS;
}
// Draw title
/* Draw title */
if (title)
{
if (separate == 0)

View File

@ -130,14 +130,14 @@ static void X86API int1A(int intno)
switch(M.x86.R_AX)
{
case 0xB101: // PCI Bios Present?
case 0xB101: /* PCI Bios Present? */
M.x86.R_AL = 0x00;
M.x86.R_EDX = 0x20494350;
M.x86.R_BX = 0x0210;
M.x86.R_CL = 3;
CLEAR_FLAG(F_CF);
break;
case 0xB102: // Find device
case 0xB102: /* Find device */
device = mypci_find_device(M.x86.R_DX, M.x86.R_CX, M.x86.R_SI);
if (device != -1)
{
@ -151,52 +151,52 @@ static void X86API int1A(int intno)
}
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
break;
case 0xB103: // Find PCI class code
case 0xB103: /* Find PCI class code */
M.x86.R_AH = PCIBIOS_DEVICE_NOT_FOUND;
//printf("Find by class not yet implmented");
/*printf("Find by class not yet implmented"); */
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
break;
case 0xB108: // read config byte
case 0xB108: /* read config byte */
M.x86.R_CL = mypci_read_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("read_config_byte %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI,
// M.x86.R_CL);
/*printf("read_config_byte %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
/* M.x86.R_CL); */
break;
case 0xB109: // read config word
case 0xB109: /* read config word */
M.x86.R_CX = mypci_read_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("read_config_word %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI,
// M.x86.R_CX);
/*printf("read_config_word %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
/* M.x86.R_CX); */
break;
case 0xB10A: // read config dword
case 0xB10A: /* read config dword */
M.x86.R_ECX = mypci_read_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI);
M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("read_config_long %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI,
// M.x86.R_ECX);
/*printf("read_config_long %x,%x,%x -> %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
/* M.x86.R_ECX); */
break;
case 0xB10B: // write config byte
case 0xB10B: /* write config byte */
mypci_write_cfg_byte(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CL);
M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("write_config_byte %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI,
// M.x86.R_CL);
/*printf("write_config_byte %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
/* M.x86.R_CL); */
break;
case 0xB10C: // write config word
case 0xB10C: /* write config word */
mypci_write_cfg_word(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_CX);
M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("write_config_word %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI,
// M.x86.R_CX);
/*printf("write_config_word %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
/* M.x86.R_CX); */
break;
case 0xB10D: // write config dword
case 0xB10D: /* write config dword */
mypci_write_cfg_long(M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, M.x86.R_ECX);
M.x86.R_AH = PCIBIOS_SUCCESSFUL;
CONDITIONAL_SET_FLAG((M.x86.R_AH != PCIBIOS_SUCCESSFUL), F_CF);
//printf("write_config_long %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI,
// M.x86.R_ECX);
/*printf("write_config_long %x,%x,%x <- %x\n", M.x86.R_BH, M.x86.R_BL, M.x86.R_DI, */
/* M.x86.R_ECX); */
break;
default:
PRINTF("BIOS int %xh: Unknown function AX=%04xh\n", intno, M.x86.R_AX);
@ -252,14 +252,14 @@ unsigned char setup_bw[] =
unsigned char * setup_modes[] =
{
setup_40x25, // mode 0: 40x25 bw text
setup_40x25, // mode 1: 40x25 col text
setup_80x25, // mode 2: 80x25 bw text
setup_80x25, // mode 3: 80x25 col text
setup_graphics, // mode 4: 320x200 col graphics
setup_graphics, // mode 5: 320x200 bw graphics
setup_graphics, // mode 6: 640x200 bw graphics
setup_bw // mode 7: 80x25 mono text
setup_40x25, /* mode 0: 40x25 bw text */
setup_40x25, /* mode 1: 40x25 col text */
setup_80x25, /* mode 2: 80x25 bw text */
setup_80x25, /* mode 3: 80x25 col text */
setup_graphics, /* mode 4: 320x200 col graphics */
setup_graphics, /* mode 5: 320x200 bw graphics */
setup_graphics, /* mode 6: 640x200 bw graphics */
setup_bw /* mode 7: 80x25 mono text */
};
unsigned int setup_cols[] =
@ -280,13 +280,13 @@ unsigned int setup_bufsize[] =
void bios_set_mode(int mode)
{
int i;
unsigned char mode_set = setup_modesets[mode]; // Control register value
unsigned char *setup_regs = setup_modes[mode]; // Register 3D4 Array
unsigned char mode_set = setup_modesets[mode]; /* Control register value */
unsigned char *setup_regs = setup_modes[mode]; /* Register 3D4 Array */
// Switch video off
/* Switch video off */
out_byte(0x3D8, mode_set & 0x37);
// Set up parameters at 3D4h
/* Set up parameters at 3D4h */
for (i=0; i<16; i++)
{
out_byte(0x3D4, (unsigned char)i);
@ -294,10 +294,10 @@ void bios_set_mode(int mode)
setup_regs++;
}
// Enable video
/* Enable video */
out_byte(0x3D8, mode_set);
// Set overscan
/* Set overscan */
if (mode == 6) out_byte(0x3D9, 0x3F);
else out_byte(0x3D9, 0x30);
}

View File

@ -401,7 +401,7 @@ int find_image(u32 rom_address, u32 rom_size, void **image, u32 *image_size)
{
int i = 0;
unsigned char *rom = (unsigned char *)rom_address;
/* if (*rom != 0x55 || *(rom+1) != 0xAA) return 0; // No bios rom this is, yes. */
/* if (*rom != 0x55 || *(rom+1) != 0xAA) return 0; /* No bios rom this is, yes. */ */
for (;;)
{
@ -479,7 +479,6 @@ void show_bat_mapping(void)
}
void remove_init_data(void)
{
char *s;

View File

@ -152,4 +152,3 @@ void PMAPI BE_exit(void);
#endif
#endif /* __BIOSEMU_H */

View File

@ -411,4 +411,3 @@ ulong _ASMAPI PCIBIOS_getEntry(void);
#endif
#endif /* __PCILIB_H */

View File

@ -164,4 +164,3 @@ typedef enum {
#endif /* !__OS2__ */
#endif /* __PMHELP_H */

View File

@ -73,4 +73,3 @@ PMHELP_CTL_CODE(GASETLOCALPATH ,0x002D),
PMHELP_CTL_CODE(GAGETEXPORTS ,0x002E),
PMHELP_CTL_CODE(GATHUNK ,0x002F),
PMHELP_CTL_CODE(SETNUCLEUSPATH ,0x0030),

View File

@ -1146,4 +1146,3 @@ int PMAPI PM_int386x(int intno, PMREGS *in, PMREGS *out,PMSREGS *sregs);
#endif
#endif /* __PMAPI_H */

View File

@ -191,4 +191,3 @@ PM_imports _VARAPI _PM_imports = {
NULL,
#endif
};

View File

@ -80,7 +80,7 @@
#ifdef __GNUC__
#ifdef __cplusplus
// G++ currently fucks this up!
/* G++ currently fucks this up! */
#define __cdecl
#define __stdcall
#else
@ -636,10 +636,10 @@ void _ASMAPI DebugVxD(void);
/* Get rid of some helaciously annoying Visual C++ warnings! */
#if defined(_MSC_VER) && !defined(__MWERKS__) && !defined(__SC__)
#pragma warning(disable:4761) // integral size mismatch in argument; conversion supplied
#pragma warning(disable:4244) // conversion from 'unsigned short ' to 'unsigned char ', possible loss of data
#pragma warning(disable:4018) // '<' : signed/unsigned mismatch
#pragma warning(disable:4305) // 'initializing' : truncation from 'const double' to 'float'
#pragma warning(disable:4761) /* integral size mismatch in argument; conversion supplied */
#pragma warning(disable:4244) /* conversion from 'unsigned short ' to 'unsigned char ', possible loss of data */
#pragma warning(disable:4018) /* '<' : signed/unsigned mismatch */
#pragma warning(disable:4305) /* 'initializing' : truncation from 'const double' to 'float' */
#endif
/*---------------------------------------------------------------------------

View File

@ -322,7 +322,7 @@ extern X86EMU_sysEnv _X86EMU_env;
/* Function to log information at runtime */
//void printk(const char *fmt, ...);
/*void printk(const char *fmt, ...); */
#ifdef __cplusplus
} /* End of "C" linkage for C++ */

View File

@ -178,4 +178,3 @@ ASFLAGS += -d__SNAP__
# Include file dependencies
.INCLUDE .IGNORE: "makefile.dep"

View File

@ -178,4 +178,3 @@ PMLIB := -lpm
# Define which file contains our rules
RULES_MAK := gcc_linux.mk

View File

@ -133,4 +133,3 @@ PMLIB := -lpm
# Define which file contains our rules
RULES_MAK := gcc_win32.mk

View File

@ -162,4 +162,3 @@ PMLIB := -lpm
# Define which file contains our rules
RULES_MAK := qnx4.mk

View File

@ -45,4 +45,3 @@ PMLIB :=
# Implicit rule for building an executable file
%$E: ; $(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB)

View File

@ -91,4 +91,3 @@ LD := $(LDXX)
@$(ECHO) ld $@
@$(LD) $(LDFLAGS) -o $@ $& $(EXELIBS) $(PMLIB) -lm
.ENDIF

View File

@ -88,4 +88,3 @@ LD := $(LDXX)
@$(ECHO) ld $@
@$(LD) $(LDFLAGS) -o $@ @$(mktmp $(&:s/\/\\) $(EXELIBS) $(PMLIB) -lm)
.ENDIF

View File

@ -262,4 +262,3 @@ dllstart.obj: dllstart.asm
@$(RM) -S $(mktmp *.lnk)
.ENDIF
.ENDIF

View File

@ -159,4 +159,3 @@ __.SILENT := $(.SILENT)
# We dont use TABS in our makefiles
.NOTABS := yes

View File

@ -351,4 +351,3 @@ LIB_BASE_DIR := $(SCITECH_LIB)\lib\release
# Define which file contains our rules
RULES_MAK := wc32.mk

View File

@ -431,13 +431,13 @@ BE_exports * _CEXPORT BE_initLibrary(
int i,max;
ulong *p;
// Initialize all default imports to point to fatal error handler
// for upwards compatibility.
/* Initialize all default imports to point to fatal error handler */
/* for upwards compatibility. */
max = sizeof(_PM_imports)/sizeof(BE_initLibrary_t);
for (i = 0,p = (ulong*)&_PM_imports; i < max; i++)
*p++ = (ulong)_PM_fatalErrorHandler;
// Now copy all our imported functions
/* Now copy all our imported functions */
memcpy(&_PM_imports,pmImp,MIN(sizeof(_PM_imports),pmImp->dwSize));
return &_BE_exports;
}

View File

@ -165,27 +165,27 @@ static void PCI_doBIOSPOST(
RMREGS regs;
RMSREGS sregs;
// Determine the value to store in AX for BIOS POST
/* Determine the value to store in AX for BIOS POST */
regs.x.ax = (u16)(PCI[DeviceIndex[device]].slot.i >> 8);
if (useV86) {
// Post the BIOS using the PM functions (ie: v86 mode on Linux)
/* Post the BIOS using the PM functions (ie: v86 mode on Linux) */
if (!PM_doBIOSPOST(regs.x.ax,BIOSPhysAddr,mappedBIOS,BIOSLen)) {
// If the PM function fails, this probably means are we are on
// DOS and can't re-map the real mode 0xC0000 region. In thise
// case if the device is the primary, we can use the real
// BIOS at 0xC0000 directly.
/* If the PM function fails, this probably means are we are on */
/* DOS and can't re-map the real mode 0xC0000 region. In thise */
/* case if the device is the primary, we can use the real */
/* BIOS at 0xC0000 directly. */
if (device == 0)
PM_doBIOSPOST(regs.x.ax,0xC0000,mappedBIOS,BIOSLen);
}
}
else {
// Setup the X86 emulator for the VGA BIOS
/* Setup the X86 emulator for the VGA BIOS */
BE_setVGA(&VGAInfo[device]);
// Execute the BIOS POST code
/* Execute the BIOS POST code */
BE_callRealMode(0xC000,0x0003,&regs,&sregs);
// Cleanup and exit
/* Cleanup and exit */
BE_getVGA(&VGAInfo[device]);
}
}
@ -206,34 +206,34 @@ static ibool PCI_postControllers(void)
char filename[_MAX_PATH];
FILE *f;
// Disable the primary display controller and AGP VGA pass-through
/* Disable the primary display controller and AGP VGA pass-through */
DISABLE_DEVICE(0);
if (AGPBridge)
DISABLE_AGP_VGA();
// Now POST all the secondary controllers
/* Now POST all the secondary controllers */
for (device = 0; device < NumDevices; device++) {
// Skip the device if it is not enabled (probably an ISA device)
/* Skip the device if it is not enabled (probably an ISA device) */
if (DeviceIndex[device] == -1)
continue;
// Enable secondary display controller. If the secondary controller
// is on the AGP bus, then enable VGA resources for the AGP device.
/* Enable secondary display controller. If the secondary controller */
/* is on the AGP bus, then enable VGA resources for the AGP device. */
ENABLE_DEVICE(device);
if (AGPBridge && AGPBridge->SecondayBusNumber == PCI[DeviceIndex[device]].slot.p.Bus)
ENABLE_AGP_VGA();
// Check if the controller has already been POST'ed
/* Check if the controller has already been POST'ed */
if (VGA_NOT_ACTIVE()) {
// Find a viable place to map the secondary PCI BIOS image and map it
/* Find a viable place to map the secondary PCI BIOS image and map it */
printk("Device %d not enabled, so attempting warm boot it\n", device);
// For AGP devices (and PCI devices that do have the ROM base
// address zero'ed out) we have to map the BIOS to a location
// that is passed by the AGP bridge to the bus. Some AGP devices
// have the ROM base address already set up for us, and some
// do not (we map to one of the existing BAR locations in
// this case).
/* For AGP devices (and PCI devices that do have the ROM base */
/* address zero'ed out) we have to map the BIOS to a location */
/* that is passed by the AGP bridge to the bus. Some AGP devices */
/* have the ROM base address already set up for us, and some */
/* do not (we map to one of the existing BAR locations in */
/* this case). */
mappedBIOS = NULL;
if (PCI[DeviceIndex[device]].ROMBaseAddress != 0)
mappedBIOSPhys = PCI[DeviceIndex[device]].ROMBaseAddress & ~0xF;
@ -248,26 +248,26 @@ static ibool PCI_postControllers(void)
memcpy(copyOfBIOS,mappedBIOS,BIOSImageLen);
PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1);
// Allocate memory to store copy of BIOS from secondary controllers
/* Allocate memory to store copy of BIOS from secondary controllers */
VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]];
VGAInfo[device].BIOSImage = copyOfBIOS;
VGAInfo[device].BIOSImageLen = BIOSImageLen;
// Restore device mappings
/* Restore device mappings */
PCI_writePCIRegL(0x30,PCI[DeviceIndex[device]].ROMBaseAddress,device);
PCI_writePCIRegL(0x10,PCI[DeviceIndex[device]].BaseAddress10,device);
PCI_writePCIRegL(0x14,PCI[DeviceIndex[device]].BaseAddress14,device);
// Now execute the BIOS POST for the device
/* Now execute the BIOS POST for the device */
if (copyOfBIOS[0] == 0x55 && copyOfBIOS[1] == 0xAA) {
printk("Executing BIOS POST for controller.\n");
PCI_doBIOSPOST(device,mappedBIOSPhys,copyOfBIOS,BIOSImageLen);
}
// Reset the size of the BIOS image to the final size
/* Reset the size of the BIOS image to the final size */
VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN;
// Save the BIOS and interrupt vector information to disk
/* Save the BIOS and interrupt vector information to disk */
sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device);
if ((f = fopen(filename,"wb")) != NULL) {
fwrite(copyOfBIOS,1,FINAL_BIOSLEN,f);
@ -276,14 +276,14 @@ static ibool PCI_postControllers(void)
}
}
else {
// Allocate memory to store copy of BIOS from secondary controllers
/* Allocate memory to store copy of BIOS from secondary controllers */
if ((copyOfBIOS = malloc(FINAL_BIOSLEN)) == NULL)
return false;
VGAInfo[device].pciInfo = &PCI[DeviceIndex[device]];
VGAInfo[device].BIOSImage = copyOfBIOS;
VGAInfo[device].BIOSImageLen = FINAL_BIOSLEN;
// Load the BIOS and interrupt vector information from disk
/* Load the BIOS and interrupt vector information from disk */
sprintf(filename,"%s/bios.%02d",PM_getNucleusConfigPath(),device);
if ((f = fopen(filename,"rb")) != NULL) {
fread(copyOfBIOS,1,FINAL_BIOSLEN,f);
@ -292,25 +292,25 @@ static ibool PCI_postControllers(void)
}
}
// Fix up all the secondary PCI base address registers
// (restores them all from the values we read previously)
/* Fix up all the secondary PCI base address registers */
/* (restores them all from the values we read previously) */
_PCI_fixupSecondaryBARs();
// Disable the secondary controller and AGP VGA pass-through
/* Disable the secondary controller and AGP VGA pass-through */
DISABLE_DEVICE(device);
if (AGPBridge)
DISABLE_AGP_VGA();
}
// Reenable primary display controller and reset AGP bridge control
/* Reenable primary display controller and reset AGP bridge control */
if (AGPBridge)
RESTORE_AGP_VGA();
ENABLE_DEVICE(0);
// Free physical BIOS image mapping
/* Free physical BIOS image mapping */
PM_freePhysicalAddr(mappedBIOS,MAX_BIOSLEN-1);
// Restore the X86 emulator BIOS info to primary controller
/* Restore the X86 emulator BIOS info to primary controller */
if (!useV86)
BE_setVGA(&VGAInfo[0]);
return true;
@ -460,15 +460,15 @@ static int PCI_enumerateDevices(void)
int i,j;
PCIBridgeInfo *info;
// If this is the first time we have been called, enumerate all
// devices on the PCI bus.
/* If this is the first time we have been called, enumerate all */
/* devices on the PCI bus. */
if (NumPCI == -1) {
for (i = 0; i < MAX_PCI_DEVICES; i++)
PCI[i].dwSize = sizeof(PCI[i]);
if ((NumPCI = PCI_enumerate(PCI,MAX_PCI_DEVICES)) == 0)
return -1;
// Build a list of all PCI bridge devices
/* Build a list of all PCI bridge devices */
for (i = 0,NumBridges = 0,BridgeIndex[0] = -1; i < NumPCI; i++) {
if (PCI[i].BaseClass == PCI_BRIDGE_CLASS) {
if (NumBridges < MAX_PCI_DEVICES)
@ -476,7 +476,7 @@ static int PCI_enumerateDevices(void)
}
}
// Now build a list of all display class devices
/* Now build a list of all display class devices */
for (i = 0,NumDevices = 1,DeviceIndex[0] = -1; i < NumPCI; i++) {
if (PCI_IS_DISPLAY_CLASS(&PCI[i])) {
if ((PCI[i].Command & 0x3) == 0x3) {
@ -487,10 +487,10 @@ static int PCI_enumerateDevices(void)
DeviceIndex[NumDevices++] = i;
}
if (PCI[i].slot.p.Bus != 0) {
// This device is on a different bus than the primary
// PCI bus, so it is probably an AGP device. Find the
// AGP bus device that controls that bus so we can
// control it.
/* This device is on a different bus than the primary */
/* PCI bus, so it is probably an AGP device. Find the */
/* AGP bus device that controls that bus so we can */
/* control it. */
for (j = 0; j < NumBridges; j++) {
info = (PCIBridgeInfo*)&PCI[BridgeIndex[j]];
if (info->SecondayBusNumber == PCI[i].slot.p.Bus) {
@ -502,7 +502,7 @@ static int PCI_enumerateDevices(void)
}
}
// Enumerate all PCI and bridge devices to log file
/* Enumerate all PCI and bridge devices to log file */
EnumeratePCI();
}
return NumDevices;
@ -548,20 +548,20 @@ int main(int argc,char *argv[])
PM_init();
if (!useV86) {
// Initialise the x86 BIOS emulator
/* Initialise the x86 BIOS emulator */
BE_init(false,debugFlags,65536,&VGAInfo[0]);
}
// Enumerate all devices (which POST's them at the same time)
/* Enumerate all devices (which POST's them at the same time) */
if (PCI_enumerateDevices() < 1) {
printk("No PCI display devices found!\n");
return -1;
}
// Post all the display controller BIOS'es
/* Post all the display controller BIOS'es */
PCI_postControllers();
// Cleanup and exit the emulator
/* Cleanup and exit the emulator */
if (!useV86)
BE_exit();
fclose(logfile);

View File

@ -197,8 +197,8 @@ void NAPI _OS_delay(
if (!inited) {
#ifndef __WIN32_VXD__
// This has been causing problems in VxD's for some reason, so for now
// we avoid using it.
/* This has been causing problems in VxD's for some reason, so for now */
/* we avoid using it. */
if (_GA_haveCPUID() && (_GA_getCPUIDFeatures() & CPU_HaveRDTSC) != 0) {
ZTimerInit();
haveRDTSC = true;
@ -217,4 +217,3 @@ void NAPI _OS_delay(
else
_OS_delay8253(microSeconds);
}

View File

@ -120,4 +120,3 @@ void _EXPORT CenterLogo(HWND hWndLogo, HWND hWndParent, int CenterY)
(RectCenter.right - RectCenter.left),
(RectCenter.bottom - RectCenter.top), false);
}

View File

@ -70,10 +70,10 @@ library is used with the application local version of Nucleus.
****************************************************************************/
PM_imports * NAPI GA_getSystemPMImports(void)
{
// TODO: We may very well want to provide a system shared library
// that eports the PM functions required by the Nucleus library
// for BeOS here. That will eliminate fatal errors loading new
// drivers on BeOS!
/* TODO: We may very well want to provide a system shared library */
/* that eports the PM functions required by the Nucleus library */
/* for BeOS here. That will eliminate fatal errors loading new */
/* drivers on BeOS! */
return &_PM_imports;
}

View File

@ -133,4 +133,3 @@ void NAPI GA_TimerRead(
{
_GA_readTimeStamp(value);
}

View File

@ -266,4 +266,3 @@ N_uint32 * NAPI GA_getLicensedDevices(ibool shared)
return __GA_exports.GA_getLicensedDevices(shared);
}
#endif

View File

@ -72,10 +72,10 @@ library is used with the application local version of Nucleus.
****************************************************************************/
PM_imports * NAPI GA_getSystemPMImports(void)
{
// TODO: We may very well want to provide a system shared library
// that eports the PM functions required by the Nucleus library
// for Linux here. That will eliminate fatal errors loading new
// drivers on Linux!
/* TODO: We may very well want to provide a system shared library */
/* that eports the PM functions required by the Nucleus library */
/* for Linux here. That will eliminate fatal errors loading new */
/* drivers on Linux! */
return &_PM_imports;
}

View File

@ -134,4 +134,3 @@ void NAPI GA_TimerRead(
else
KeQuerySystemTime((LARGE_INTEGER*)value);
}

View File

@ -72,10 +72,10 @@ library is used with the application local version of Nucleus.
****************************************************************************/
PM_imports * NAPI GA_getSystemPMImports(void)
{
// TODO: We may very well want to provide a system shared library
// that eports the PM functions required by the Nucleus library
// for QNX here. That will eliminate fatal errors loading new
// drivers on QNX!
/* TODO: We may very well want to provide a system shared library */
/* that eports the PM functions required by the Nucleus library */
/* for QNX here. That will eliminate fatal errors loading new */
/* drivers on QNX! */
return &_PM_imports;
}

View File

@ -134,4 +134,3 @@ void NAPI GA_TimerRead(
else
VTD_Get_Real_Time(&value->high,&value->low);
}

View File

@ -188,7 +188,7 @@ ibool NAPI GA_queryFunctions(
static ibool (NAPIP _GA_queryFunctions)(GA_devCtx *dc,N_uint32 id,void _FAR_ *funcs) = NULL;
if (useRing0Driver) {
// Call the version in nga_w32.dll if it is loaded
/* Call the version in nga_w32.dll if it is loaded */
if (!_GA_queryFunctions) {
if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"_GA_queryFunctions")) == NULL)
if ((_GA_queryFunctions = (void*)GetProcAddress(hModDLL,"__GA_queryFunctions")) == NULL)
@ -211,7 +211,7 @@ ibool NAPI REF2D_queryFunctions(
static ibool (NAPIP _REF2D_queryFunctions)(REF2D_driver *ref2d,N_uint32 id,void _FAR_ *funcs) = NULL;
if (useRing0Driver) {
// Call the version in nga_w32.dll if it is loaded
/* Call the version in nga_w32.dll if it is loaded */
if (!_REF2D_queryFunctions) {
if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"_REF2D_queryFunctions")) == NULL)
if ((_REF2D_queryFunctions = (void*)GetProcAddress(hModDLL,"__REF2D_queryFunctions")) == NULL)
@ -253,4 +253,3 @@ void NAPI GA_TimerRead(
else
QueryPerformanceCounter((LARGE_INTEGER*)value);
}

View File

@ -444,7 +444,7 @@ int _CDECL stub_isatty(int _fildes)
int _CDECL stub_unlink(const char *_path)
{
// TODO: Implement this!
/* TODO: Implement this! */
return -1;
}
@ -454,7 +454,7 @@ int _CDECL stub_remove(const char *_filename)
int _CDECL stub_rename(const char *_old, const char *_new)
{
// TODO: Implement this!
/* TODO: Implement this! */
return -1;
}
@ -825,4 +825,3 @@ void * _CDECL stub_signal(int sig, void *handler)
return (void*)signal(sig,(__code_ptr)handler);
#endif
}

View File

@ -584,4 +584,3 @@ int PEAPI PE_getError(void)
{
return result;
}

View File

@ -64,8 +64,8 @@ Initialise the counter and return the frequency of the counter.
static void GetCounterFrequency(
CPU_largeInteger *freq)
{
// TODO: Return the frequency of the counter in here. You should try to
// normalise this value to be around 100,000 ticks per second.
/* TODO: Return the frequency of the counter in here. You should try to */
/* normalise this value to be around 100,000 ticks per second. */
freq->low = 1000000;
freq->high = 0;
}

View File

@ -59,7 +59,7 @@ events.
****************************************************************************/
ulong _EVT_getTicks(void)
{
// TODO: Implement this for your OS!
/* TODO: Implement this for your OS! */
}
/****************************************************************************
@ -68,36 +68,36 @@ Pumps all messages in the application message queue into our event queue.
****************************************************************************/
static void _EVT_pumpMessages(void)
{
// TODO: The purpose of this function is to read all keyboard and mouse
// events from the OS specific event queue, translate them and post
// them into the SciTech event queue.
//
// NOTE: There are a couple of important things that this function must
// take care of:
//
// 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required.
//
// 2. Support for reading hardware scan code as well as ASCII
// translated values is required. Games use the scan codes rather
// than ASCII values. Scan codes go into the high order byte of the
// keyboard message field.
//
// 3. Support for at least reading mouse motion data (mickeys) from the
// mouse is required. Using the mickey values, we can then translate
// to mouse cursor coordinates scaled to the range of the current
// graphics display mode. Mouse values are scaled based on the
// global 'rangeX' and 'rangeY'.
//
// 4. Support for a timestamp for the events is required, which is
// defined as the number of milliseconds since some event (usually
// system startup). This is the timestamp when the event occurred
// (ie: at interrupt time) not when it was stuff into the SciTech
// event queue.
//
// 5. Support for mouse double click events. If the OS has a native
// mechanism to determine this, it should be used. Otherwise the
// time stamp information will be used by the generic event code
// to generate double click events.
/* TODO: The purpose of this function is to read all keyboard and mouse */
/* events from the OS specific event queue, translate them and post */
/* them into the SciTech event queue. */
/* */
/* NOTE: There are a couple of important things that this function must */
/* take care of: */
/* */
/* 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. */
/* */
/* 2. Support for reading hardware scan code as well as ASCII */
/* translated values is required. Games use the scan codes rather */
/* than ASCII values. Scan codes go into the high order byte of the */
/* keyboard message field. */
/* */
/* 3. Support for at least reading mouse motion data (mickeys) from the */
/* mouse is required. Using the mickey values, we can then translate */
/* to mouse cursor coordinates scaled to the range of the current */
/* graphics display mode. Mouse values are scaled based on the */
/* global 'rangeX' and 'rangeY'. */
/* */
/* 4. Support for a timestamp for the events is required, which is */
/* defined as the number of milliseconds since some event (usually */
/* system startup). This is the timestamp when the event occurred */
/* (ie: at interrupt time) not when it was stuff into the SciTech */
/* event queue. */
/* */
/* 5. Support for mouse double click events. If the OS has a native */
/* mechanism to determine this, it should be used. Otherwise the */
/* time stamp information will be used by the generic event code */
/* to generate double click events. */
}
/****************************************************************************
@ -141,7 +141,7 @@ void EVTAPI EVT_init(
initEventQueue();
memset(keyUpMsg,0,sizeof(keyUpMsg));
// TODO: Do any OS specific initialisation here
/* TODO: Do any OS specific initialisation here */
/* Catch program termination signals so we can clean up properly */
signal(SIGABRT, _EVT_abort);
@ -171,7 +171,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for non DOS systems
/* Do nothing for non DOS systems */
}
/****************************************************************************
@ -181,7 +181,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for non DOS systems
/* Do nothing for non DOS systems */
}
/****************************************************************************
@ -195,5 +195,5 @@ void EVT_exit(void)
signal(SIGFPE, SIG_DFL);
signal(SIGINT, SIG_DFL);
// TODO: Do any OS specific cleanup in here
/* TODO: Do any OS specific cleanup in here */
}

View File

@ -28,5 +28,5 @@
*
****************************************************************************/
// This is where you include OS specific headers for the event handling
// library.
/* This is where you include OS specific headers for the event handling */
/* library. */

View File

@ -38,7 +38,7 @@
#include <stdlib.h>
#include <string.h>
// TODO: Include any BeOS specific headers here!
/* TODO: Include any BeOS specific headers here! */
/*--------------------------- Global variables ----------------------------*/
@ -48,12 +48,12 @@ static void (PMAPIP fatalErrorCleanup)(void) = NULL;
void PMAPI PM_init(void)
{
// TODO: Do any initialisation in here. This includes getting IOPL
// access for the process calling PM_init. This will get called
// more than once.
/* TODO: Do any initialisation in here. This includes getting IOPL */
/* access for the process calling PM_init. This will get called */
/* more than once. */
// TODO: If you support the supplied MTRR register stuff (you need to
// be at ring 0 for this!), you should initialise it in here.
/* TODO: If you support the supplied MTRR register stuff (you need to */
/* be at ring 0 for this!), you should initialise it in here. */
/* MTRR_init(); */
}
@ -81,9 +81,9 @@ void PMAPI PM_setFatalErrorCleanup(
void PMAPI PM_fatalError(const char *msg)
{
// TODO: If you are running in a GUI environment without a console,
// this needs to be changed to bring up a fatal error message
// box and terminate the program.
/* TODO: If you are running in a GUI environment without a console, */
/* this needs to be changed to bring up a fatal error message */
/* box and terminate the program. */
if (fatalErrorCleanup)
fatalErrorCleanup();
fprintf(stderr,"%s\n", msg);
@ -92,101 +92,101 @@ void PMAPI PM_fatalError(const char *msg)
void * PMAPI PM_getVESABuf(uint *len,uint *rseg,uint *roff)
{
// No BIOS access for the BeOS
/* No BIOS access for the BeOS */
return NULL;
}
int PMAPI PM_kbhit(void)
{
// TODO: This function checks if a key is available to be read. This
// should be implemented, but is mostly used by the test programs
// these days.
/* TODO: This function checks if a key is available to be read. This */
/* should be implemented, but is mostly used by the test programs */
/* these days. */
return true;
}
int PMAPI PM_getch(void)
{
// TODO: This returns the ASCII code of the key pressed. This
// should be implemented, but is mostly used by the test programs
// these days.
/* TODO: This returns the ASCII code of the key pressed. This */
/* should be implemented, but is mostly used by the test programs */
/* these days. */
return 0xD;
}
int PMAPI PM_openConsole(void)
{
// TODO: Opens up a fullscreen console for graphics output. If your
// console does not have graphics/text modes, this can be left
// empty. The main purpose of this is to disable console switching
// when in graphics modes if you can switch away from fullscreen
// consoles (if you want to allow switching, this can be done
// elsewhere with a full save/restore state of the graphics mode).
/* TODO: Opens up a fullscreen console for graphics output. If your */
/* console does not have graphics/text modes, this can be left */
/* empty. The main purpose of this is to disable console switching */
/* when in graphics modes if you can switch away from fullscreen */
/* consoles (if you want to allow switching, this can be done */
/* elsewhere with a full save/restore state of the graphics mode). */
return 0;
}
int PMAPI PM_getConsoleStateSize(void)
{
// TODO: Returns the size of the console state buffer used to save the
// state of the console before going into graphics mode. This is
// used to restore the console back to normal when we are done.
/* TODO: Returns the size of the console state buffer used to save the */
/* state of the console before going into graphics mode. This is */
/* used to restore the console back to normal when we are done. */
return 1;
}
void PMAPI PM_saveConsoleState(void *stateBuf,int console_id)
{
// TODO: Saves the state of the console into the state buffer. This is
// used to restore the console back to normal when we are done.
// We will always restore 80x25 text mode after being in graphics
// mode, so if restoring text mode is all you need to do this can
// be left empty.
/* TODO: Saves the state of the console into the state buffer. This is */
/* used to restore the console back to normal when we are done. */
/* We will always restore 80x25 text mode after being in graphics */
/* mode, so if restoring text mode is all you need to do this can */
/* be left empty. */
}
void PMAPI PM_restoreConsoleState(const void *stateBuf,int console_id)
{
// TODO: Restore the state of the console from the state buffer. This is
// used to restore the console back to normal when we are done.
// We will always restore 80x25 text mode after being in graphics
// mode, so if restoring text mode is all you need to do this can
// be left empty.
/* TODO: Restore the state of the console from the state buffer. This is */
/* used to restore the console back to normal when we are done. */
/* We will always restore 80x25 text mode after being in graphics */
/* mode, so if restoring text mode is all you need to do this can */
/* be left empty. */
}
void PMAPI PM_closeConsole(int console_id)
{
// TODO: Close the console when we are done, going back to text mode.
/* TODO: Close the console when we are done, going back to text mode. */
}
void PM_setOSCursorLocation(int x,int y)
{
// TODO: Set the OS console cursor location to the new value. This is
// generally used for new OS ports (used mostly for DOS).
/* TODO: Set the OS console cursor location to the new value. This is */
/* generally used for new OS ports (used mostly for DOS). */
}
void PM_setOSScreenWidth(int width,int height)
{
// TODO: Set the OS console screen width. This is generally unused for
// new OS ports.
/* TODO: Set the OS console screen width. This is generally unused for */
/* new OS ports. */
}
ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
{
// TODO: Install a real time clock interrupt handler. Normally this
// will not be supported from most OS'es in user land, so an
// alternative mechanism is needed to enable software stereo.
// Hence leave this unimplemented unless you have a high priority
// mechanism to call the 32-bit callback when the real time clock
// interrupt fires.
/* TODO: Install a real time clock interrupt handler. Normally this */
/* will not be supported from most OS'es in user land, so an */
/* alternative mechanism is needed to enable software stereo. */
/* Hence leave this unimplemented unless you have a high priority */
/* mechanism to call the 32-bit callback when the real time clock */
/* interrupt fires. */
return false;
}
void PMAPI PM_setRealTimeClockFrequency(int frequency)
{
// TODO: Set the real time clock interrupt frequency. Used for stereo
// LC shutter glasses when doing software stereo. Usually sets
// the frequency to around 2048 Hz.
/* TODO: Set the real time clock interrupt frequency. Used for stereo */
/* LC shutter glasses when doing software stereo. Usually sets */
/* the frequency to around 2048 Hz. */
}
void PMAPI PM_restoreRealTimeClockHandler(void)
{
// TODO: Restores the real time clock handler.
/* TODO: Restores the real time clock handler. */
}
char * PMAPI PM_getCurrentPath(
@ -219,8 +219,8 @@ const char * PMAPI PM_getNucleusConfigPath(void)
const char * PMAPI PM_getUniqueID(void)
{
// TODO: Return a unique ID for the machine. If a unique ID is not
// available, return the machine name.
/* TODO: Return a unique ID for the machine. If a unique ID is not */
/* available, return the machine name. */
static char buf[128];
gethostname(buf, 128);
return buf;
@ -228,7 +228,7 @@ const char * PMAPI PM_getUniqueID(void)
const char * PMAPI PM_getMachineName(void)
{
// TODO: Return the network machine name for the machine.
/* TODO: Return the network machine name for the machine. */
static char buf[128];
gethostname(buf, 128);
return buf;
@ -236,7 +236,7 @@ const char * PMAPI PM_getMachineName(void)
void * PMAPI PM_getBIOSPointer(void)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
return NULL;
}
@ -250,49 +250,49 @@ void * PMAPI PM_getA0000Pointer(void)
void * PMAPI PM_mapPhysicalAddr(ulong base,ulong limit,ibool isCached)
{
// TODO: This function maps a physical memory address to a linear
// address in the address space of the calling process.
/* TODO: This function maps a physical memory address to a linear */
/* address in the address space of the calling process. */
// NOTE: This function *must* be able to handle any phsyical base
// address, and hence you will have to handle rounding of
// the physical base address to a page boundary (ie: 4Kb on
// x86 CPU's) to be able to properly map in the memory
// region.
/* NOTE: This function *must* be able to handle any phsyical base */
/* address, and hence you will have to handle rounding of */
/* the physical base address to a page boundary (ie: 4Kb on */
/* x86 CPU's) to be able to properly map in the memory */
/* region. */
// NOTE: If possible the isCached bit should be used to ensure that
// the PCD (Page Cache Disable) and PWT (Page Write Through)
// bits are set to disable caching for a memory mapping used
// for MMIO register access. We also disable caching using
// the MTRR registers for Pentium Pro and later chipsets so if
// MTRR support is enabled for your OS then you can safely ignore
// the isCached flag and always enable caching in the page
// tables.
/* NOTE: If possible the isCached bit should be used to ensure that */
/* the PCD (Page Cache Disable) and PWT (Page Write Through) */
/* bits are set to disable caching for a memory mapping used */
/* for MMIO register access. We also disable caching using */
/* the MTRR registers for Pentium Pro and later chipsets so if */
/* MTRR support is enabled for your OS then you can safely ignore */
/* the isCached flag and always enable caching in the page */
/* tables. */
return NULL;
}
void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
{
// TODO: This function will free a physical memory mapping previously
// allocated with PM_mapPhysicalAddr() if at all possible. If
// you can't free physical memory mappings, simply do nothing.
/* TODO: This function will free a physical memory mapping previously */
/* allocated with PM_mapPhysicalAddr() if at all possible. If */
/* you can't free physical memory mappings, simply do nothing. */
}
ulong PMAPI PM_getPhysicalAddr(void *p)
{
// TODO: This function should find the physical address of a linear
// address.
/* TODO: This function should find the physical address of a linear */
/* address. */
return 0xFFFFFFFFUL;
}
void PMAPI PM_sleep(ulong milliseconds)
{
// TODO: Put the process to sleep for milliseconds
/* TODO: Put the process to sleep for milliseconds */
}
int PMAPI PM_getCOMPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3F8;
case 1: return 0x2F8;
@ -302,8 +302,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3BC;
case 1: return 0x378;
@ -314,142 +314,142 @@ int PMAPI PM_getLPTPort(int port)
void * PMAPI PM_mallocShared(long size)
{
// TODO: This is used to allocate memory that is shared between process
// that all access the common Nucleus drivers via a common display
// driver DLL. If your OS does not support shared memory (or if
// the display driver does not need to allocate shared memory
// for each process address space), this should just call PM_malloc.
/* TODO: This is used to allocate memory that is shared between process */
/* that all access the common Nucleus drivers via a common display */
/* driver DLL. If your OS does not support shared memory (or if */
/* the display driver does not need to allocate shared memory */
/* for each process address space), this should just call PM_malloc. */
return PM_malloc(size);
}
void PMAPI PM_freeShared(void *ptr)
{
// TODO: Free the shared memory block. This will be called in the context
// of the original calling process that allocated the shared
// memory with PM_mallocShared. Simply call free if you do not
// need this.
/* TODO: Free the shared memory block. This will be called in the context */
/* of the original calling process that allocated the shared */
/* memory with PM_mallocShared. Simply call free if you do not */
/* need this. */
PM_free(ptr);
}
void * PMAPI PM_mapToProcess(void *base,ulong limit)
{
// TODO: This function is used to map a physical memory mapping
// previously allocated with PM_mapPhysicalAddr into the
// address space of the calling process. If the memory mapping
// allocated by PM_mapPhysicalAddr is global to all processes,
// simply return the pointer.
/* TODO: This function is used to map a physical memory mapping */
/* previously allocated with PM_mapPhysicalAddr into the */
/* address space of the calling process. If the memory mapping */
/* allocated by PM_mapPhysicalAddr is global to all processes, */
/* simply return the pointer. */
return base;
}
void * PMAPI PM_mapRealPointer(uint r_seg,uint r_off)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
return NULL;
}
void * PMAPI PM_allocRealSeg(uint size,uint *r_seg,uint *r_off)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
return NULL;
}
void PMAPI PM_freeRealSeg(void *mem)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
}
void PMAPI DPMI_int86(int intno, DPMI_regs *regs)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
}
int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
return 0;
}
int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
RMSREGS *sregs)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
return 0;
}
void PMAPI PM_callRealMode(uint seg,uint off, RMREGS *in,
RMSREGS *sregs)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
}
void PMAPI PM_availableMemory(ulong *physical,ulong *total)
{
// TODO: Report the amount of available memory, both the amount of
// physical memory left and the amount of virtual memory left.
// If the OS does not provide these services, report 0's.
/* TODO: Report the amount of available memory, both the amount of */
/* physical memory left and the amount of virtual memory left. */
/* If the OS does not provide these services, report 0's. */
*physical = *total = 0;
}
void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16Meg)
{
// TODO: Allocate a block of locked, physical memory of the specified
// size. This is used for bus master operations. If this is not
// supported by the OS, return NULL and bus mastering will not
// be used.
/* TODO: Allocate a block of locked, physical memory of the specified */
/* size. This is used for bus master operations. If this is not */
/* supported by the OS, return NULL and bus mastering will not */
/* be used. */
return NULL;
}
void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
{
// TODO: Free a memory block allocated with PM_allocLockedMem.
/* TODO: Free a memory block allocated with PM_allocLockedMem. */
}
void PMAPI PM_setBankA(int bank)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
}
void PMAPI PM_setBankAB(int bank)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
}
void PMAPI PM_setCRTStart(int x,int y,int waitVRT)
{
// No BIOS access on the BeOS
/* No BIOS access on the BeOS */
}
ibool PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type)
{
// TODO: This function should enable Pentium Pro and Pentium II MTRR
// write combining for the passed in physical memory base address
// and length. Normally this is done via calls to an OS specific
// device driver as this can only be done at ring 0.
//
// NOTE: This is a *very* important function to implement! If you do
// not implement, graphics performance on the latest Intel chips
// will be severly impaired. For sample code that can be used
// directly in a ring 0 device driver, see the MSDOS implementation
// which includes assembler code to do this directly (if the
// program is running at ring 0).
/* TODO: This function should enable Pentium Pro and Pentium II MTRR */
/* write combining for the passed in physical memory base address */
/* and length. Normally this is done via calls to an OS specific */
/* device driver as this can only be done at ring 0. */
/* */
/* NOTE: This is a *very* important function to implement! If you do */
/* not implement, graphics performance on the latest Intel chips */
/* will be severly impaired. For sample code that can be used */
/* directly in a ring 0 device driver, see the MSDOS implementation */
/* which includes assembler code to do this directly (if the */
/* program is running at ring 0). */
return false;
}
ibool PMAPI PM_doBIOSPOST(ushort axVal,ulong BIOSPhysAddr,void *mappedBIOS)
{
// TODO: This function is used to run the BIOS POST code on a secondary
// controller to initialise it for use. This is not necessary
// for multi-controller operation, but it will make it a lot
// more convenicent for end users (otherwise they have to boot
// the system once with the secondary controller as primary, and
// then boot with both controllers installed).
//
// Even if you don't support full BIOS access, it would be
// adviseable to be able to POST the secondary controllers in the
// system using this function as a minimum requirement. Some
// graphics hardware has registers that contain values that only
// the BIOS knows about, which makes bring up a card from cold
// reset difficult if the BIOS has not POST'ed it.
/* TODO: This function is used to run the BIOS POST code on a secondary */
/* controller to initialise it for use. This is not necessary */
/* for multi-controller operation, but it will make it a lot */
/* more convenicent for end users (otherwise they have to boot */
/* the system once with the secondary controller as primary, and */
/* then boot with both controllers installed). */
/* */
/* Even if you don't support full BIOS access, it would be */
/* adviseable to be able to POST the secondary controllers in the */
/* system using this function as a minimum requirement. Some */
/* graphics hardware has registers that contain values that only */
/* the BIOS knows about, which makes bring up a card from cold */
/* reset difficult if the BIOS has not POST'ed it. */
return false;
}
@ -533,7 +533,7 @@ void PMAPI PM_setFileAttr(
const char *filename,
uint attrib)
{
// TODO: Set the file attributes for a file
/* TODO: Set the file attributes for a file */
(void)filename;
(void)attrib;
}

View File

@ -36,7 +36,7 @@ Initialise the Zen Timer module internals.
****************************************************************************/
void _ZTimerInit(void)
{
// TODO: Do any specific internal initialisation in here
/* TODO: Do any specific internal initialisation in here */
}
/****************************************************************************
@ -46,8 +46,8 @@ Start the Zen Timer counting.
static void _LZTimerOn(
LZTimerObject *tm)
{
// TODO: Start the Zen Timer counting. This should be a macro if
// possible.
/* TODO: Start the Zen Timer counting. This should be a macro if */
/* possible. */
}
/****************************************************************************
@ -57,8 +57,8 @@ Compute the lap time since the timer was started.
static ulong _LZTimerLap(
LZTimerObject *tm)
{
// TODO: Compute the lap time between the current time and when the
// timer was started.
/* TODO: Compute the lap time between the current time and when the */
/* timer was started. */
return 0;
}
@ -69,7 +69,7 @@ Stop the Zen Timer counting.
static void _LZTimerOff(
LZTimerObject *tm)
{
// TODO: Stop the timer counting. Should be a macro if possible.
/* TODO: Stop the timer counting. Should be a macro if possible. */
}
/****************************************************************************
@ -79,7 +79,7 @@ Compute the elapsed time in microseconds between start and end timings.
static ulong _LZTimerCount(
LZTimerObject *tm)
{
// TODO: Compute the elapsed time and return it. Always microseconds.
/* TODO: Compute the elapsed time and return it. Always microseconds. */
return 0;
}
@ -95,9 +95,9 @@ Read the Long Period timer from the OS
****************************************************************************/
static ulong _ULZReadTime(void)
{
// TODO: Read the long period timer from the OS. The resolution of this
// timer should be around 1/20 of a second for timing long
// periods if possible.
/* TODO: Read the long period timer from the OS. The resolution of this */
/* timer should be around 1/20 of a second for timing long */
/* periods if possible. */
}
/****************************************************************************

View File

@ -187,4 +187,3 @@ ibool PMAPI PM_agpFreePhysical(
}
#endif /* !REALMODE */

View File

@ -447,4 +447,3 @@ void EVTAPI EVT_allowLEDS(
setLEDS(0);
EVT.allowLEDS = enable;
}

View File

@ -280,7 +280,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime,
PM_time *time)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)filename;
(void)gmTime;
(void)time;
@ -297,7 +297,7 @@ ibool PMAPI PM_setFileTime(
ibool gmTime,
PM_time *time)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)filename;
(void)gmTime;
(void)time;

View File

@ -75,7 +75,7 @@ static void EVTAPI _EVT_pumpMessages(void)
_EVT_restoreInt(ps);
}
regs.x.ax = 0x0B; // Reset Move Mouse
regs.x.ax = 0x0B; /* Reset Move Mouse */
PM_int86(0x33,&regs,&regs);
}
#endif

View File

@ -813,9 +813,9 @@ ibool PMAPI PM_driveValid(
{
RMREGS regs;
regs.h.dl = (uchar)(drive - 'A' + 1);
regs.h.ah = 0x36; // Get disk information service
regs.h.ah = 0x36; /* Get disk information service */
PM_int86(0x21,&regs,&regs);
return regs.x.ax != 0xFFFF; // AX = 0xFFFF if disk is invalid
return regs.x.ax != 0xFFFF; /* AX = 0xFFFF if disk is invalid */
}
/****************************************************************************
@ -2212,7 +2212,7 @@ Function to get the file attributes for a specific file.
uint PMAPI PM_getFileAttr(
const char *filename)
{
// TODO: Implement this!
/* TODO: Implement this! */
return 0;
}
@ -2225,7 +2225,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime,
PM_time *time)
{
// TODO: Implement this!
/* TODO: Implement this! */
return false;
}
@ -2238,6 +2238,6 @@ ibool PMAPI PM_setFileTime(
ibool gmTime,
PM_time *time)
{
// TODO: Implement this!
/* TODO: Implement this! */
return false;
}

View File

@ -89,7 +89,7 @@ mouse_info mouse_infos[] = {
{"BusMouse", STD_FLG, NULL, {0xf8, 0x80, 0x00, 0x00}, 3, 3},
{"MouseMan", CS7 | STD_FLG, _EVT_mouse_init, {0x40, 0x40, 0x40, 0x00}, 3, 1},
{"IntelliMouse", CS7 | STD_FLG, _EVT_pnpmouse_init, {0xc0, 0x40, 0xc0, 0x00}, 4, 1},
{"IMPS2", CS7 | STD_FLG, NULL, {0xc0, 0x40, 0xc0, 0x00}, 4, 1}, // ?
{"IMPS2", CS7 | STD_FLG, NULL, {0xc0, 0x40, 0xc0, 0x00}, 4, 1}, /* ? */
};
#define NB_MICE (sizeof(mouse_infos)/sizeof(mouse_info))
@ -109,7 +109,7 @@ typedef struct {
int map;
} keymap;
// TODO: Fix this and set it up so we can do a binary search!
/* TODO: Fix this and set it up so we can do a binary search! */
keymap keymaps[] = {
{96, KB_padEnter},
@ -539,7 +539,7 @@ int EVTAPI EVT_joyIsPresent(void)
joystick0_fd = 0;
if ((joystick1_fd = open(joystick1_dev, O_RDONLY)) < 0)
joystick1_fd = 0;
if (!joystick0_fd && !joystick1_fd) // No joysticks detected
if (!joystick0_fd && !joystick1_fd) /* No joysticks detected */
return 0;
inited = true;
if (ioctl(joystick0_fd ? joystick0_fd : joystick1_fd, JSIOCGVERSION, &js_version) < 0)
@ -820,11 +820,11 @@ static void _EVT_pumpMessages(void)
release = c & 0x80;
c &= 0x7F;
// TODO: This is wrong! We need this to be the time stamp at
// ** interrupt ** time!! One solution would be to
// put the keyboard and mouse polling loops into
// a separate thread that can block on I/O to the
// necessay file descriptor.
/* TODO: This is wrong! We need this to be the time stamp at */
/* ** interrupt ** time!! One solution would be to */
/* put the keyboard and mouse polling loops into */
/* a separate thread that can block on I/O to the */
/* necessay file descriptor. */
evt.when = _EVT_getTicks();
if (release) {
@ -966,11 +966,11 @@ static void _EVT_pumpMessages(void)
evt.relative_x = dx;
evt.relative_y = dy;
// TODO: This is wrong! We need this to be the time stamp at
// ** interrupt ** time!! One solution would be to
// put the keyboard and mouse polling loops into
// a separate thread that can block on I/O to the
// necessay file descriptor.
/* TODO: This is wrong! We need this to be the time stamp at */
/* ** interrupt ** time!! One solution would be to */
/* put the keyboard and mouse polling loops into */
/* a separate thread that can block on I/O to the */
/* necessay file descriptor. */
evt.when = _EVT_getTicks();
evt.modifiers = _PM_modifiers;
if (buts & 4)
@ -1038,7 +1038,7 @@ static void _EVT_pumpMessages(void)
}
#ifdef USE_OS_JOYSTICK
// Poll joystick events using the 1.x joystick driver API in the 2.2 kernels
/* Poll joystick events using the 1.x joystick driver API in the 2.2 kernels */
if (js_version & ~0xffff) {
static struct js_event js;
@ -1318,7 +1318,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for Linux
/* Do nothing for Linux */
}
/****************************************************************************
@ -1328,7 +1328,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for Linux
/* Do nothing for Linux */
}
/****************************************************************************
@ -1358,4 +1358,3 @@ void EVT_exit(void)
}
#endif
}

View File

@ -58,4 +58,3 @@ void _PM_keyboard_rawmode(void);
/* Linux needs the generic joystick scaling code */
#define NEED_SCALE_JOY_AXIS

View File

@ -562,37 +562,37 @@ int PMAPI PM_getch(void)
c &= 0x7F;
if (release) {
switch(c){
case 42: case 54: // Shift
case 42: case 54: /* Shift */
_PM_modifiers &= ~KB_SHIFT;
break;
case 29: case 97: // Control
case 29: case 97: /* Control */
_PM_modifiers &= ~KB_CONTROL;
break;
case 56: case 100: // Alt / AltGr
case 56: case 100: /* Alt / AltGr */
_PM_modifiers &= ~KB_ALT;
break;
}
continue;
}
switch (c) {
case 42: case 54: // Shift
case 42: case 54: /* Shift */
_PM_modifiers |= KB_SHIFT;
break;
case 29: case 97: // Control
case 29: case 97: /* Control */
_PM_modifiers |= KB_CONTROL;
break;
case 56: case 100: // Alt / AltGr
case 56: case 100: /* Alt / AltGr */
_PM_modifiers |= KB_ALT;
break;
case 58: // Caps Lock
case 58: /* Caps Lock */
_PM_modifiers ^= KB_CAPS;
ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
break;
case 69: // Num Lock
case 69: /* Num Lock */
_PM_modifiers ^= KB_NUMLOCK;
ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
break;
case 70: // Scroll Lock
case 70: /* Scroll Lock */
_PM_modifiers ^= KB_SCROLL;
ioctl(_PM_console_fd, KDSETLED, _PM_modifiers & 7);
break;
@ -855,12 +855,12 @@ void PM_setOSScreenWidth(int width,int height)
struct winsize ws;
struct vt_sizes vs;
// Resize the software terminal
/* Resize the software terminal */
ws.ws_col = width;
ws.ws_row = height;
ioctl(_PM_console_fd, TIOCSWINSZ, &ws);
// And the hardware
/* And the hardware */
vs.v_rows = height;
vs.v_cols = width;
vs.v_scrollsize = 0;
@ -869,18 +869,18 @@ void PM_setOSScreenWidth(int width,int height)
ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
{
// TODO: Implement this for Linux
/* TODO: Implement this for Linux */
return false;
}
void PMAPI PM_setRealTimeClockFrequency(int frequency)
{
// TODO: Implement this for Linux
/* TODO: Implement this for Linux */
}
void PMAPI PM_restoreRealTimeClockHandler(void)
{
// TODO: Implement this for Linux
/* TODO: Implement this for Linux */
}
char * PMAPI PM_getCurrentPath(
@ -978,27 +978,27 @@ void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
ulong PMAPI PM_getPhysicalAddr(void *p)
{
// TODO: This function should find the physical address of a linear
// address.
/* TODO: This function should find the physical address of a linear */
/* address. */
return 0xFFFFFFFFUL;
}
ibool PMAPI PM_getPhysicalAddrRange(void *p,ulong length,ulong *physAddress)
{
// TODO: This function should find a range of physical addresses
// for a linear address.
/* TODO: This function should find a range of physical addresses */
/* for a linear address. */
return false;
}
void PMAPI PM_sleep(ulong milliseconds)
{
// TODO: Put the process to sleep for milliseconds
/* TODO: Put the process to sleep for milliseconds */
}
int PMAPI PM_getCOMPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3F8;
case 1: return 0x2F8;
@ -1008,8 +1008,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3BC;
case 1: return 0x378;
@ -1558,26 +1558,26 @@ void PMAPI PM_availableMemory(ulong *physical,ulong *total)
void * PMAPI PM_allocLockedMem(uint size,ulong *physAddr,ibool contiguous,ibool below16M)
{
// TODO: Implement this for Linux
/* TODO: Implement this for Linux */
return NULL;
}
void PMAPI PM_freeLockedMem(void *p,uint size,ibool contiguous)
{
// TODO: Implement this for Linux
/* TODO: Implement this for Linux */
}
void * PMAPI PM_allocPage(
ibool locked)
{
// TODO: Implement this for Linux
/* TODO: Implement this for Linux */
return NULL;
}
void PMAPI PM_freePage(
void *p)
{
// TODO: Implement this for Linux
/* TODO: Implement this for Linux */
}
void PMAPI PM_setBankA(int bank)
@ -1661,7 +1661,7 @@ int PMAPI PM_enableWriteCombine(ulong base,ulong length,uint type)
sentry.size = length;
sentry.type = type;
if (ioctl(mtrr_fd, MTRRIOC_ADD_ENTRY, &sentry) == -1) {
// TODO: Need to decode MTRR error codes!!
/* TODO: Need to decode MTRR error codes!! */
return PM_MTRR_NOT_SUPPORTED;
}
return PM_MTRR_ERR_OK;
@ -1690,8 +1690,8 @@ int PMAPI PM_enumWriteCombine(
for (gentry.regnum = 0; ioctl (mtrr_fd, MTRRIOC_GET_ENTRY, &gentry) == 0;
++gentry.regnum) {
if (gentry.size > 0) {
// WARNING: This code assumes that the types in pmapi.h match the ones
// in the Linux kernel (mtrr.h)
/* WARNING: This code assumes that the types in pmapi.h match the ones */
/* in the Linux kernel (mtrr.h) */
callback(gentry.base, gentry.size, gentry.type);
}
}
@ -1774,7 +1774,7 @@ int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName)
{
// TODO: Implement this to load shared libraries!
/* TODO: Implement this to load shared libraries! */
(void)szDLLName;
return NULL;
}
@ -1783,7 +1783,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule,
const char *szProcName)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
(void)szProcName;
return NULL;
@ -1792,19 +1792,18 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary(
PM_MODULE hModule)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
}
int PMAPI PM_setIOPL(
int level)
{
// TODO: Move the IOPL switching into this function!!
/* TODO: Move the IOPL switching into this function!! */
return level;
}
void PMAPI PM_flushTLB(void)
{
// Do nothing on Linux.
/* Do nothing on Linux. */
}

View File

@ -62,4 +62,3 @@ Read the counter and return the counter value.
(t)->low = lt.LowPart; \
(t)->high = lt.HighPart; \
}

View File

@ -43,7 +43,7 @@ We do have limited BIOS access under Windows NT device drivers.
****************************************************************************/
ibool PMAPI PM_haveBIOSAccess(void)
{
// Return false unless we have full buffer passing!
/* Return false unless we have full buffer passing! */
return false;
}
@ -63,8 +63,8 @@ void * PMAPI PM_getVESABuf(
uint *rseg,
uint *roff)
{
// No buffers supported under Windows NT (Windows XP has them however if
// we ever decide to support this!)
/* No buffers supported under Windows NT (Windows XP has them however if */
/* we ever decide to support this!) */
return NULL;
}
@ -90,7 +90,7 @@ void * PMAPI PM_mapRealPointer(
uint r_seg,
uint r_off)
{
// Not used for Windows NT drivers!
/* Not used for Windows NT drivers! */
return NULL;
}
@ -103,7 +103,7 @@ void * PMAPI PM_allocRealSeg(
uint *r_seg,
uint *r_off)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)size;
(void)r_seg;
(void)r_off;
@ -117,7 +117,7 @@ Free a block of real mode memory.
void PMAPI PM_freeRealSeg(
void *mem)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)mem;
}
@ -129,7 +129,7 @@ void PMAPI DPMI_int86(
int intno,
DPMI_regs *regs)
{
// Not used in NT drivers
/* Not used in NT drivers */
}
/****************************************************************************
@ -143,7 +143,7 @@ void PMAPI PM_callRealMode(
RMREGS *regs,
RMSREGS *sregs)
{
// TODO!!
/* TODO!! */
#if 0
CLIENT_STRUCT saveRegs;
@ -174,7 +174,7 @@ int PMAPI PM_int86(
RMREGS *in,
RMREGS *out)
{
// TODO!!
/* TODO!! */
#if 0
RMSREGS sregs = {0};
CLIENT_STRUCT saveRegs;
@ -214,7 +214,7 @@ int PMAPI PM_int86x(
RMREGS *out,
RMSREGS *sregs)
{
// TODO!!
/* TODO!! */
#if 0
CLIENT_STRUCT saveRegs;
ushort oldDisable;
@ -249,4 +249,3 @@ int PMAPI PM_int86x(
#endif
return out->x.ax;
}

View File

@ -140,4 +140,3 @@ void PMAPI PM_restoreRealTimeClockHandler(void)
_PM_rtcHandler = NULL;
}
}

View File

@ -70,7 +70,7 @@ static memlocked locked[MAX_MEMORY_LOCKED];
ulong PMAPI _PM_getPDB(void);
// Page table entry flags
/* Page table entry flags */
#define PAGE_FLAGS_PRESENT 0x00000001
#define PAGE_FLAGS_WRITEABLE 0x00000002
@ -100,10 +100,10 @@ static ulong _PM_mapPhysicalToLinear(
ulong length = limit+1;
PHYSICAL_ADDRESS paIoBase = {0};
// NT loves large Ints
/* NT loves large Ints */
paIoBase = RtlConvertUlongToLargeInteger( base );
// Map IO space into Kernel
/* Map IO space into Kernel */
if (isCached)
return (ULONG)MmMapIoSpace(paIoBase, length, MmCached );
else
@ -149,12 +149,12 @@ static void _PM_adjustPageTables(
endPDB = ((linear+limit) >> 22) & 0x3FF;
endPage = ((linear+limit) >> 12) & 0x3FF;
for (iPDB = startPDB; iPDB <= endPDB; iPDB++) {
// Set the bits in the page directory entry - required as per
// Pentium 4 manual. This also takes care of the 4MB page entries
/* Set the bits in the page directory entry - required as per */
/* Pentium 4 manual. This also takes care of the 4MB page entries */
pPDB[iPDB] = (pPDB[iPDB] & mask) | bits;
if (!(pPDB[iPDB] & PAGE_FLAGS_4MB)) {
// If we are dealing with 4KB pages then we need to iterate
// through each of the page table entries
/* If we are dealing with 4KB pages then we need to iterate */
/* through each of the page table entries */
pageTable = pPDB[iPDB] & ~0xFFF;
pPageTable = (ulong*)_PM_mapPhysicalToLinear(pageTable,0xFFF,true);
start = (iPDB == startPDB) ? startPage : 0;
@ -183,7 +183,7 @@ void * PMAPI PM_mallocShared(
{
int i;
// First find a free slot in our shared memory table
/* First find a free slot in our shared memory table */
for (i = 0; i < MAX_MEMORY_SHARED; i++) {
if (shared[i].linear == 0)
break;
@ -191,16 +191,16 @@ void * PMAPI PM_mallocShared(
if (i == MAX_MEMORY_SHARED)
return NULL;
// Allocate the paged pool
/* Allocate the paged pool */
shared[i].linear = ExAllocatePool(PagedPool, size);
// Create a list to manage this allocation
/* Create a list to manage this allocation */
shared[i].pMdl = IoAllocateMdl(shared[i].linear,size,FALSE,FALSE,(PIRP) NULL);
// Lock this allocation in memory
/* Lock this allocation in memory */
MmProbeAndLockPages(shared[i].pMdl,KernelMode,IoModifyAccess);
// Modify bits to grant user access
/* Modify bits to grant user access */
_PM_adjustPageTables((ulong)shared[i].linear, size, true, true);
return (void*)shared[i].linear;
}
@ -214,19 +214,19 @@ void PMAPI PM_freeShared(
{
int i;
// Find a shared memory block in our table and free it
/* Find a shared memory block in our table and free it */
for (i = 0; i < MAX_MEMORY_SHARED; i++) {
if (shared[i].linear == p) {
// Unlock what we locked
/* Unlock what we locked */
MmUnlockPages(shared[i].pMdl);
// Free our MDL
/* Free our MDL */
IoFreeMdl(shared[i].pMdl);
// Free our mem
/* Free our mem */
ExFreePool(shared[i].linear);
// Flag that is entry is available
/* Flag that is entry is available */
shared[i].linear = 0;
break;
}
@ -245,8 +245,8 @@ void * PMAPI PM_mapPhysicalAddr(
ulong linear,length = limit+1;
int i;
// Search table of existing mappings to see if we have already mapped
// a region of memory that will serve this purpose.
/* Search table of existing mappings to see if we have already mapped */
/* a region of memory that will serve this purpose. */
for (i = 0; i < numMappings; i++) {
if (maps[i].physical == base && maps[i].length == length && maps[i].isCached == isCached) {
_PM_adjustPageTables((ulong)maps[i].linear, maps[i].length, true, isCached);
@ -256,7 +256,7 @@ void * PMAPI PM_mapPhysicalAddr(
if (numMappings == MAX_MEMORY_MAPPINGS)
return NULL;
// We did not find any previously mapped memory region, so maps it in.
/* We did not find any previously mapped memory region, so maps it in. */
if ((linear = _PM_mapPhysicalToLinear(base,limit,isCached)) == 0xFFFFFFFF)
return NULL;
maps[numMappings].physical = base;
@ -265,7 +265,7 @@ void * PMAPI PM_mapPhysicalAddr(
maps[numMappings].isCached = isCached;
numMappings++;
// Grant user access to this I/O space
/* Grant user access to this I/O space */
_PM_adjustPageTables((ulong)linear, length, true, isCached);
return (void*)linear;
}
@ -278,8 +278,8 @@ void PMAPI PM_freePhysicalAddr(
void *ptr,
ulong limit)
{
// We don't free the memory mappings in here because we cache all
// the memory mappings we create in the system for later use.
/* We don't free the memory mappings in here because we cache all */
/* the memory mappings we create in the system for later use. */
}
/****************************************************************************
@ -340,7 +340,7 @@ void * PMAPI PM_allocLockedMem(
int i;
PHYSICAL_ADDRESS paOurAddress;
// First find a free slot in our shared memory table
/* First find a free slot in our shared memory table */
for (i = 0; i < MAX_MEMORY_LOCKED; i++) {
if (locked[i].linear == 0)
break;
@ -348,9 +348,9 @@ void * PMAPI PM_allocLockedMem(
if (i == MAX_MEMORY_LOCKED)
return NULL;
// HighestAcceptableAddress - Specifies the highest valid physical address
// the driver can use. For example, if a device can only reference physical
// memory in the lower 16MB, this value would be set to 0x00000000FFFFFF.
/* HighestAcceptableAddress - Specifies the highest valid physical address */
/* the driver can use. For example, if a device can only reference physical */
/* memory in the lower 16MB, this value would be set to 0x00000000FFFFFF. */
paOurAddress.HighPart = 0;
if (below16M)
paOurAddress.LowPart = 0x00FFFFFF;
@ -358,37 +358,37 @@ void * PMAPI PM_allocLockedMem(
paOurAddress.LowPart = 0xFFFFFFFF;
if (contiguous) {
// Allocate from the non-paged pool (unfortunately 4MB pages)
/* Allocate from the non-paged pool (unfortunately 4MB pages) */
locked[i].linear = MmAllocateContiguousMemory(size, paOurAddress);
if (!locked[i].linear)
return NULL;
// Flag no MDL
/* Flag no MDL */
locked[i].pMdl = NULL;
// Map the physical address for the memory so we can manage
// the page tables in 4KB chunks mapped into user space.
/* Map the physical address for the memory so we can manage */
/* the page tables in 4KB chunks mapped into user space. */
// TODO: Map this with the physical address to the linear addresss
/* TODO: Map this with the physical address to the linear addresss */
locked[i].mmIoMapped = locked[i].linear;
// Modify bits to grant user access, flag not cached
/* Modify bits to grant user access, flag not cached */
_PM_adjustPageTables((ulong)locked[i].mmIoMapped, size, true, false);
return (void*)locked[i].mmIoMapped;
}
else {
// Allocate from the paged pool
/* Allocate from the paged pool */
locked[i].linear = ExAllocatePool(PagedPool, size);
if (!locked[i].linear)
return NULL;
// Create a list to manage this allocation
/* Create a list to manage this allocation */
locked[i].pMdl = IoAllocateMdl(locked[i].linear,size,FALSE,FALSE,(PIRP) NULL);
// Lock this allocation in memory
/* Lock this allocation in memory */
MmProbeAndLockPages(locked[i].pMdl,KernelMode,IoModifyAccess);
// Modify bits to grant user access, flag not cached
/* Modify bits to grant user access, flag not cached */
_PM_adjustPageTables((ulong)locked[i].linear, size, true, false);
return (void*)locked[i].linear;
}
@ -408,22 +408,22 @@ void PMAPI PM_freeLockedMem(
/* Find a locked memory block in our table and free it */
for (i = 0; i < MAX_MEMORY_LOCKED; i++) {
if (locked[i].linear == p) {
// An Mdl indicates that we used the paged pool, and locked it,
// so now we have to unlock, free the MDL, and free paged
/* An Mdl indicates that we used the paged pool, and locked it, */
/* so now we have to unlock, free the MDL, and free paged */
if (locked[i].pMdl) {
// Unlock what we locked and free the Mdl
/* Unlock what we locked and free the Mdl */
MmUnlockPages(locked[i].pMdl);
IoFreeMdl(locked[i].pMdl);
ExFreePool(locked[i].linear);
}
else {
// TODO: Free the mmIoMap mapping for the memory!
/* TODO: Free the mmIoMap mapping for the memory! */
// Free non-paged pool
/* Free non-paged pool */
MmFreeContiguousMemory(locked[i].linear);
}
// Flag that is entry is available
/* Flag that is entry is available */
locked[i].linear = 0;
break;
}
@ -437,8 +437,8 @@ Allocates a page aligned and page sized block of memory
void * PMAPI PM_allocPage(
ibool locked)
{
// Allocate the memory from the non-paged pool if we want the memory
// to be locked.
/* Allocate the memory from the non-paged pool if we want the memory */
/* to be locked. */
return ExAllocatePool(
locked ? NonPagedPoolCacheAligned : PagedPoolCacheAligned,
PAGE_SIZE);
@ -465,11 +465,11 @@ int PMAPI PM_lockDataPages(
{
MDL *pMdl;
// Create a list to manage this allocation
/* Create a list to manage this allocation */
if ((pMdl = IoAllocateMdl(p,len,FALSE,FALSE,(PIRP)NULL)) == NULL)
return false;
// Lock this allocation in memory
/* Lock this allocation in memory */
MmProbeAndLockPages(pMdl,KernelMode,IoModifyAccess);
*((PMDL*)(&lh->h)) = pMdl;
return true;
@ -485,7 +485,7 @@ int PMAPI PM_unlockDataPages(
PM_lockHandle *lh)
{
if (p && lh) {
// Unlock what we locked
/* Unlock what we locked */
MDL *pMdl = *((PMDL*)(&lh->h));
MmUnlockPages(pMdl);
IoFreeMdl(pMdl);
@ -516,4 +516,3 @@ int PMAPI PM_unlockCodePages(
{
return PM_unlockDataPages((void*)p,len,lh);
}

View File

@ -42,5 +42,4 @@
UNICODE_STRING * _PM_CStringToUnicodeString(const char *cstr);
void _PM_FreeUnicodeString(UNICODE_STRING *uniStr);
#endif // __NTDRV_OSHDR_H
#endif /* __NTDRV_OSHDR_H */

View File

@ -118,23 +118,23 @@ void PMAPI PM_fatalError(
if (fatalErrorCleanup)
fatalErrorCleanup();
#ifdef DBG // Send output to debugger, just return so as not to force a reboot
#ifdef DBG /* Send output to debugger, just return so as not to force a reboot */
#pragma message("INFO: building for debug, PM_fatalError() re-routed")
DBGMSG2("SDDHELP> PM_fatalError(): ERROR: %s\n", msg);
return ;
#endif
// KeBugCheckEx brings down the system in a controlled
// manner when the caller discovers an unrecoverable
// inconsistency that would corrupt the system if
// the caller continued to run.
//
// hack - dump the first 20 chars in hex using the variables
// provided - Each ULONG is equal to four characters...
/* KeBugCheckEx brings down the system in a controlled */
/* manner when the caller discovers an unrecoverable */
/* inconsistency that would corrupt the system if */
/* the caller continued to run. */
/* */
/* hack - dump the first 20 chars in hex using the variables */
/* provided - Each ULONG is equal to four characters... */
for(len = 0; len < 20; len++)
if (msg[len] == (char)0)
break;
// This looks bad but it's quick and reliable...
/* This looks bad but it's quick and reliable... */
p = (char *)&BugCheckCode;
if(len > 0) p[3] = msg[0];
if(len > 1) p[2] = msg[1];
@ -165,7 +165,7 @@ void PMAPI PM_fatalError(
if(len > 18) p[1] = msg[18];
if(len > 19) p[0] = msg[19];
// Halt the system!
/* Halt the system! */
KeBugCheckEx(BugCheckCode, MoreBugCheckData[0], MoreBugCheckData[1], MoreBugCheckData[2], MoreBugCheckData[3]);
}
@ -209,14 +209,14 @@ static ibool REG_queryString(
STRING stringdata;
UNICODE_STRING unidata;
// Convert strings to UniCode
/* Convert strings to UniCode */
status = false;
if ((uniKey = _PM_CStringToUnicodeString(szKey)) == NULL)
goto Exit;
if ((uniValue = _PM_CStringToUnicodeString(szValue)) == NULL)
goto Exit;
// Open the key
/* Open the key */
InitializeObjectAttributes( &keyAttributes,
uniKey,
OBJ_CASE_INSENSITIVE,
@ -228,7 +228,7 @@ static ibool REG_queryString(
if (!NT_SUCCESS(rval))
goto Exit;
// Query the value
/* Query the value */
length = sizeof (KEY_VALUE_FULL_INFORMATION)
+ size * sizeof(WCHAR);
if ((fullInfo = ExAllocatePool (PagedPool, length)) == NULL)
@ -241,12 +241,12 @@ static ibool REG_queryString(
length,
&length);
if (NT_SUCCESS (rval)) {
// Create the UniCode string so we can convert it
/* Create the UniCode string so we can convert it */
unidata.Buffer = (PWCHAR)(((PCHAR)fullInfo) + fullInfo->DataOffset);
unidata.Length = (USHORT)fullInfo->DataLength;
unidata.MaximumLength = (USHORT)fullInfo->DataLength + sizeof(WCHAR);
// Convert unicode univalue to ansi string.
/* Convert unicode univalue to ansi string. */
rval = RtlUnicodeStringToAnsiString(&stringdata, &unidata, TRUE);
if (NT_SUCCESS(rval)) {
strcpy(value,stringdata.Buffer);
@ -345,7 +345,7 @@ Check if a key has been pressed.
****************************************************************************/
int PMAPI PM_kbhit(void)
{
// Not used in NT drivers
/* Not used in NT drivers */
return true;
}
@ -355,7 +355,7 @@ Wait for and return the next keypress.
****************************************************************************/
int PMAPI PM_getch(void)
{
// Not used in NT drivers
/* Not used in NT drivers */
return 0xD;
}
@ -372,7 +372,7 @@ PM_HWND PMAPI PM_openConsole(
int bpp,
ibool fullScreen)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)hwndUser;
(void)device;
(void)xRes;
@ -388,7 +388,7 @@ Find the size of the console state buffer.
****************************************************************************/
int PMAPI PM_getConsoleStateSize(void)
{
// Not used in NT drivers
/* Not used in NT drivers */
return 1;
}
@ -400,7 +400,7 @@ void PMAPI PM_saveConsoleState(
void *stateBuf,
PM_HWND hwndConsole)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)stateBuf;
(void)hwndConsole;
}
@ -412,7 +412,7 @@ Set the suspend application callback for the fullscreen console.
void PMAPI PM_setSuspendAppCallback(
PM_saveState_cb saveState)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)saveState;
}
@ -424,7 +424,7 @@ void PMAPI PM_restoreConsoleState(
const void *stateBuf,
PM_HWND hwndConsole)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)stateBuf;
(void)hwndConsole;
}
@ -436,7 +436,7 @@ Close the fullscreen console.
void PMAPI PM_closeConsole(
PM_HWND hwndConsole)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)hwndConsole;
}
@ -475,7 +475,7 @@ void * PMAPI PM_mapToProcess(
void *base,
ulong limit)
{
// Not used anymore
/* Not used anymore */
(void)base;
(void)limit;
return NULL;
@ -491,7 +491,7 @@ ibool PMAPI PM_doBIOSPOST(
void *mappedBIOS,
ulong BIOSLen)
{
// This may not be possible in NT and should be done by the OS anyway
/* This may not be possible in NT and should be done by the OS anyway */
(void)axVal;
(void)BIOSPhysAddr;
(void)mappedBIOS;
@ -505,7 +505,7 @@ Return a pointer to the real mode BIOS data area.
****************************************************************************/
void * PMAPI PM_getBIOSPointer(void)
{
// Note that on NT this probably does not do what we expect!
/* Note that on NT this probably does not do what we expect! */
return PM_mapPhysicalAddr(0x400, 0x1000, true);
}
@ -525,7 +525,7 @@ Sleep for the specified number of milliseconds.
void PMAPI PM_sleep(
ulong milliseconds)
{
// We never use this in NT drivers
/* We never use this in NT drivers */
(void)milliseconds;
}
@ -535,8 +535,8 @@ Return the base I/O port for the specified COM port.
****************************************************************************/
int PMAPI PM_getCOMPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3F8;
case 1: return 0x2F8;
@ -552,8 +552,8 @@ Return the base I/O port for the specified LPT port.
****************************************************************************/
int PMAPI PM_getLPTPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3BC;
case 1: return 0x378;
@ -580,7 +580,7 @@ OS specific shared libraries not supported inside a VxD
PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)szDLLName;
return NULL;
}
@ -593,7 +593,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule,
const char *szProcName)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)hModule;
(void)szProcName;
return NULL;
@ -606,7 +606,7 @@ OS specific shared libraries not supported inside a VxD
void PMAPI PM_freeLibrary(
PM_MODULE hModule)
{
// Not used in NT drivers
/* Not used in NT drivers */
(void)hModule;
}
@ -618,9 +618,9 @@ void *PMAPI PM_findFirstFile(
const char *filename,
PM_findData *findData)
{
// TODO: This function should start a directory enumeration search
// given the filename (with wildcards). The data should be
// converted and returned in the findData standard form.
/* TODO: This function should start a directory enumeration search */
/* given the filename (with wildcards). The data should be */
/* converted and returned in the findData standard form. */
(void)filename;
(void)findData;
return PM_FILE_INVALID;
@ -634,10 +634,10 @@ ibool PMAPI PM_findNextFile(
void *handle,
PM_findData *findData)
{
// TODO: This function should find the next file in directory enumeration
// search given the search criteria defined in the call to
// PM_findFirstFile. The data should be converted and returned
// in the findData standard form.
/* TODO: This function should find the next file in directory enumeration */
/* search given the search criteria defined in the call to */
/* PM_findFirstFile. The data should be converted and returned */
/* in the findData standard form. */
(void)handle;
(void)findData;
return false;
@ -650,8 +650,8 @@ Function to close the find process
void PMAPI PM_findClose(
void *handle)
{
// TODO: This function should close the find process. This may do
// nothing for some OS'es.
/* TODO: This function should close the find process. This may do */
/* nothing for some OS'es. */
(void)handle;
}
@ -671,7 +671,7 @@ numbering is:
ibool PMAPI PM_driveValid(
char drive)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)drive;
return false;
}
@ -687,7 +687,7 @@ void PMAPI PM_getdcwd(
char *dir,
int len)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)drive;
(void)dir;
(void)len;
@ -733,7 +733,7 @@ void PMAPI PM_setFileAttr(
char kernelFilename[PM_MAX_PATH+5];
ULONG FileAttributes = 0;
// Convert file attribute flags
/* Convert file attribute flags */
if (attrib & PM_FILE_READONLY)
FileAttributes |= FILE_ATTRIBUTE_READONLY;
if (attrib & PM_FILE_ARCHIVE)
@ -743,15 +743,15 @@ void PMAPI PM_setFileAttr(
if (attrib & PM_FILE_SYSTEM)
FileAttributes |= FILE_ATTRIBUTE_SYSTEM;
// Add prefix for addressing the file system. "\??\" is short for "\DosDevices\"
/* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
strcpy(kernelFilename, "\\??\\");
strcat(kernelFilename, filename);
// Convert filename string to ansi string
/* Convert filename string to ansi string */
if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
goto Exit;
// Must open a file to query it's attributes
/* Must open a file to query it's attributes */
InitializeObjectAttributes (&ObjectAttributes,
uniFile,
OBJ_CASE_INSENSITIVE,
@ -761,18 +761,18 @@ void PMAPI PM_setFileAttr(
DesiredAccess | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL, //AllocationSize OPTIONAL,
NULL, /*AllocationSize OPTIONAL, */
FILE_ATTRIBUTE_NORMAL,
ShareAccess,
CreateDisposition,
FILE_RANDOM_ACCESS, //CreateOptions,
NULL, //EaBuffer OPTIONAL,
0 //EaLength (required if EaBuffer)
FILE_RANDOM_ACCESS, /*CreateOptions, */
NULL, /*EaBuffer OPTIONAL, */
0 /*EaLength (required if EaBuffer) */
);
if (!NT_SUCCESS (status))
goto Exit;
// Query timestamps
/* Query timestamps */
status = ZwQueryInformationFile(FileHandle,
&IoStatusBlock,
&FileBasic,
@ -782,12 +782,12 @@ void PMAPI PM_setFileAttr(
if (!NT_SUCCESS (status))
goto Exit;
// Change the four bits we change
/* Change the four bits we change */
FileBasic.FileAttributes &= ~(FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_ARCHIVE
| FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM);
FileBasic.FileAttributes |= FileAttributes;
// Set timestamps
/* Set timestamps */
ZwSetInformationFile( FileHandle,
&IoStatusBlock,
&FileBasic,
@ -821,15 +821,15 @@ uint PMAPI PM_getFileAttr(
ULONG FileAttributes = 0;
uint retval = 0;
// Add prefix for addressing the file system. "\??\" is short for "\DosDevices\"
/* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
strcpy(kernelFilename, "\\??\\");
strcat(kernelFilename, filename);
// Convert filename string to ansi string
/* Convert filename string to ansi string */
if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
goto Exit;
// Must open a file to query it's attributes
/* Must open a file to query it's attributes */
InitializeObjectAttributes (&ObjectAttributes,
uniFile,
OBJ_CASE_INSENSITIVE,
@ -839,18 +839,18 @@ uint PMAPI PM_getFileAttr(
DesiredAccess | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL, //AllocationSize OPTIONAL,
NULL, /*AllocationSize OPTIONAL, */
FILE_ATTRIBUTE_NORMAL,
ShareAccess,
CreateDisposition,
FILE_RANDOM_ACCESS, //CreateOptions,
NULL, //EaBuffer OPTIONAL,
0 //EaLength (required if EaBuffer)
FILE_RANDOM_ACCESS, /*CreateOptions, */
NULL, /*EaBuffer OPTIONAL, */
0 /*EaLength (required if EaBuffer) */
);
if (!NT_SUCCESS (status))
goto Exit;
// Query timestamps
/* Query timestamps */
status = ZwQueryInformationFile(FileHandle,
&IoStatusBlock,
&FileBasic,
@ -860,7 +860,7 @@ uint PMAPI PM_getFileAttr(
if (!NT_SUCCESS (status))
goto Exit;
// Translate the file attributes
/* Translate the file attributes */
if (FileBasic.FileAttributes & FILE_ATTRIBUTE_READONLY)
retval |= PM_FILE_READONLY;
if (FileBasic.FileAttributes & FILE_ATTRIBUTE_ARCHIVE)
@ -883,7 +883,7 @@ Function to create a directory.
ibool PMAPI PM_mkdir(
const char *filename)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)filename;
return false;
}
@ -895,7 +895,7 @@ Function to remove a directory.
ibool PMAPI PM_rmdir(
const char *filename)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)filename;
return false;
}
@ -909,7 +909,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime,
PM_time *time)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)filename;
(void)gmTime;
(void)time;
@ -925,10 +925,9 @@ ibool PMAPI PM_setFileTime(
ibool gmTime,
PM_time *time)
{
// Not supported in NT drivers
/* Not supported in NT drivers */
(void)filename;
(void)gmTime;
(void)time;
return false;
}

View File

@ -42,7 +42,7 @@ FILE * fopen(
const char *filename,
const char *mode)
{
ACCESS_MASK DesiredAccess; // for ZwCreateFile...
ACCESS_MASK DesiredAccess; /* for ZwCreateFile... */
OBJECT_ATTRIBUTES ObjectAttributes;
ULONG ShareAccess;
ULONG CreateDisposition;
@ -56,7 +56,7 @@ FILE * fopen(
char kernelFilename[PM_MAX_PATH+5];
FILE *f;
// Add prefix for addressing the file system. "\??\" is short for "\DosDevices\"
/* Add prefix for addressing the file system. "\??\" is short for "\DosDevices\" */
strcpy(kernelFilename, "\\??\\");
strcat(kernelFilename, filename);
if ((f = PM_malloc(sizeof(FILE))) == NULL)
@ -65,32 +65,32 @@ FILE * fopen(
f->text = (mode[1] == 't' || mode[2] == 't');
f->writemode = (mode[0] == 'w') || (mode[0] == 'a');
if (mode[0] == 'r') {
// omode = OPEN_ACCESS_READONLY | OPEN_SHARE_COMPATIBLE;
// action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_FAIL;
/* omode = OPEN_ACCESS_READONLY | OPEN_SHARE_COMPATIBLE; */
/* action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_FAIL; */
DesiredAccess = GENERIC_READ;
ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
CreateDisposition = FILE_OPEN;
}
else if (mode[0] == 'w') {
// omode = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_COMPATIBLE;
// action = ACTION_IFEXISTS_TRUNCATE | ACTION_IFNOTEXISTS_CREATE;
/* omode = OPEN_ACCESS_WRITEONLY | OPEN_SHARE_COMPATIBLE; */
/* action = ACTION_IFEXISTS_TRUNCATE | ACTION_IFNOTEXISTS_CREATE; */
DesiredAccess = GENERIC_WRITE;
ShareAccess = FILE_SHARE_READ | FILE_SHARE_WRITE;
CreateDisposition = FILE_SUPERSEDE;
}
else {
// omode = OPEN_ACCESS_READWRITE | OPEN_SHARE_COMPATIBLE;
// action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_CREATE;
/* omode = OPEN_ACCESS_READWRITE | OPEN_SHARE_COMPATIBLE; */
/* action = ACTION_IFEXISTS_OPEN | ACTION_IFNOTEXISTS_CREATE; */
DesiredAccess = GENERIC_READ | GENERIC_WRITE;
ShareAccess = FILE_SHARE_READ;
CreateDisposition = FILE_OPEN_IF;
}
// Convert filename string to ansi string and then to UniCode string
/* Convert filename string to ansi string and then to UniCode string */
if ((uniFile = _PM_CStringToUnicodeString(kernelFilename)) == NULL)
return NULL;
// Create the file
/* Create the file */
InitializeObjectAttributes (&ObjectAttributes,
uniFile,
OBJ_CASE_INSENSITIVE,
@ -100,19 +100,19 @@ FILE * fopen(
DesiredAccess | SYNCHRONIZE,
&ObjectAttributes,
&IoStatusBlock,
NULL, // AllocationSize OPTIONAL,
NULL, /* AllocationSize OPTIONAL, */
FILE_ATTRIBUTE_NORMAL,
ShareAccess,
CreateDisposition,
FILE_RANDOM_ACCESS, // CreateOptions,
NULL, // EaBuffer OPTIONAL,
0 // EaLength (required if EaBuffer)
FILE_RANDOM_ACCESS, /* CreateOptions, */
NULL, /* EaBuffer OPTIONAL, */
0 /* EaLength (required if EaBuffer) */
);
if (!NT_SUCCESS (status))
goto Error;
f->handle = (int)FileHandle;
// Determine size of the file
/* Determine size of the file */
status = ZwQueryInformationFile( FileHandle,
&IoStatusBlock,
&FileInformation,
@ -123,7 +123,7 @@ FILE * fopen(
goto Error;
f->filesize = FileInformation.EndOfFile.LowPart;
// Move to the end of the file if we are appending
/* Move to the end of the file if we are appending */
if (mode[0] == 'a') {
FilePosition.CurrentByteOffset.HighPart = 0;
FilePosition.CurrentByteOffset.LowPart = f->filesize;
@ -158,18 +158,18 @@ size_t fread(
IO_STATUS_BLOCK IoStatusBlock;
LARGE_INTEGER ByteOffset;
// Read any extra bytes from the file
/* Read any extra bytes from the file */
ByteOffset.HighPart = 0;
ByteOffset.LowPart = f->offset;
status = ZwReadFile( (HANDLE)f->handle,
NULL, //IN HANDLE Event OPTIONAL,
NULL, // IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
NULL, // IN PVOID ApcContext OPTIONAL,
NULL, /*IN HANDLE Event OPTIONAL, */
NULL, /* IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, */
NULL, /* IN PVOID ApcContext OPTIONAL, */
&IoStatusBlock,
ptr, // OUT PVOID Buffer,
size * n, //IN ULONG Length,
&ByteOffset, //OPTIONAL,
NULL //IN PULONG Key OPTIONAL
ptr, /* OUT PVOID Buffer, */
size * n, /*IN ULONG Length, */
&ByteOffset, /*OPTIONAL, */
NULL /*IN PULONG Key OPTIONAL */
);
if (!NT_SUCCESS (status))
return 0;
@ -196,14 +196,14 @@ size_t fwrite(
ByteOffset.HighPart = 0;
ByteOffset.LowPart = f->offset;
status = ZwWriteFile( (HANDLE)f->handle,
NULL, //IN HANDLE Event OPTIONAL,
NULL, // IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
NULL, // IN PVOID ApcContext OPTIONAL,
NULL, /*IN HANDLE Event OPTIONAL, */
NULL, /* IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, */
NULL, /* IN PVOID ApcContext OPTIONAL, */
&IoStatusBlock,
(void*)ptr, // OUT PVOID Buffer,
size * n, //IN ULONG Length,
&ByteOffset, //OPTIONAL,
NULL //IN PULONG Key OPTIONAL
(void*)ptr, /* OUT PVOID Buffer, */
size * n, /*IN ULONG Length, */
&ByteOffset, /*OPTIONAL, */
NULL /*IN PULONG Key OPTIONAL */
);
if (!NT_SUCCESS (status))
return 0;
@ -220,7 +220,7 @@ NT driver implementation of the ANSI C fflush function.
int fflush(
FILE *f)
{
// Nothing to do here as we are not doing buffered I/O
/* Nothing to do here as we are not doing buffered I/O */
(void)f;
return 0;
}
@ -289,11 +289,11 @@ char *fgets(
int len;
char *cs;
// Read the entire buffer into memory (our functions are unbuffered!)
/* Read the entire buffer into memory (our functions are unbuffered!) */
if ((len = fread(s,1,n,f)) == 0)
return NULL;
// Search for '\n' or end of string
/* Search for '\n' or end of string */
if (n > len)
n = len;
cs = s;
@ -328,4 +328,3 @@ int fclose(
PM_free(f);
return 0;
}

View File

@ -102,11 +102,11 @@ UNICODE_STRING *_PM_CStringToUnicodeString(
ANSI_STRING ansiStr;
UNICODE_STRING *uniStr;
// Allocate memory for the string structure
/* Allocate memory for the string structure */
if ((uniStr = ExAllocatePool(NonPagedPool, sizeof(UNICODE_STRING))) == NULL)
return NULL;
// Allocate memory for the wide string itself
/* Allocate memory for the wide string itself */
length = (strlen(cstr) * sizeof(WCHAR)) + sizeof(WCHAR);
if ((uniStr->Buffer = ExAllocatePool(NonPagedPool, length)) == NULL) {
ExFreePool(uniStr);
@ -116,7 +116,7 @@ UNICODE_STRING *_PM_CStringToUnicodeString(
uniStr->Length = 0;
uniStr->MaximumLength = (USHORT)length;
// Convert filename string to ansi string and then to UniCode string
/* Convert filename string to ansi string and then to UniCode string */
RtlInitAnsiString(&ansiStr, cstr);
RtlAnsiStringToUnicodeString(uniStr, &ansiStr, FALSE);
return uniStr;
@ -137,4 +137,3 @@ void _PM_FreeUnicodeString(
ExFreePool(uniStr);
}
}

View File

@ -121,4 +121,3 @@ passed, so if this happens we will be generating erronous results.
****************************************************************************/
ulong __ULZElapsedTime(ulong start,ulong finish)
{ return finish - start; }

View File

@ -87,8 +87,8 @@ Converts a mickey movement value to a pixel adjustment value.
static int MickeyToPixel(
int mickey)
{
// TODO: We can add some code in here to handle 'acceleration' for
// the mouse cursor. For now just use the mickeys.
/* TODO: We can add some code in here to handle 'acceleration' for */
/* the mouse cursor. For now just use the mickeys. */
return mickey;
}
@ -369,15 +369,15 @@ static void _kbdMonThread(
continue;
}
//TODO: to be removed
/*TODO: to be removed */
/* Skip extended scancodes & some others */
if (((kp.MonFlagWord >> 8) == 0xE0) || ((kp.KbdDDFlagWord & 0x0F) == 0x0F)) {
DosMonWrite((PBYTE)&monOutbuf, (PBYTE)&kp, count);
continue;
}
// printf("RawScan = %X, XlatedScan = %X, fbStatus = %X, KbdDDFlags = %X\n",
// kp.MonFlagWord >> 8, kp.XlatedScan, kp.u.ShiftState, kp.KbdDDFlagWord);
/* printf("RawScan = %X, XlatedScan = %X, fbStatus = %X, KbdDDFlags = %X\n", */
/* kp.MonFlagWord >> 8, kp.XlatedScan, kp.u.ShiftState, kp.KbdDDFlagWord); */
/* Protect access to buffer with mutex semaphore */
rc = DosRequestMutexSem(hmtxKeyBuf, 1000);
@ -395,7 +395,7 @@ static void _kbdMonThread(
kpNew = 0;
if (kpNew != kpTail) {
memcpy(&keyMonPkts[kpHead], &kp, sizeof(KEYPACKET));
// TODO: fix this!
/* TODO: fix this! */
/* Convert break to make code */
keyMonPkts[kpHead].MonFlagWord &= 0x7FFF;
kpHead = kpNew;
@ -517,7 +517,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for OS/2
/* Do nothing for OS/2 */
}
/****************************************************************************
@ -527,7 +527,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for OS/2
/* Do nothing for OS/2 */
}
/****************************************************************************
@ -563,4 +563,3 @@ void EVT_exit(void)
DosCloseMutexSem(hmtxKeyBuf);
KbdFlushBuffer(0);
}

View File

@ -63,55 +63,55 @@ typedef struct _MLNPACKET {
USHORT KbdDDFlagWord;
} MLNPACKET;
// DBCSStatus
/* DBCSStatus */
#define SF_SHIFTS 1 // If set to 1, shift status returned without a character
#define SF_NOTCHAR 2 // 0 - Scan code is a character
// 1 - Scan code is not a character;
// instead it is an extended key code from the keyboard.
#define SF_IMMEDIATE 32 // If set to 1, immediate conversion requested
#define SF_TYPEMASK 192 // Has the following values:
// 00 - Undefined
// 01 - Final character; interim character flag is turned off
// 10 - Interim character
// 11 - Final character; interim character flag is turned on.
// MonFlagWord
#define SF_SHIFTS 1 /* If set to 1, shift status returned without a character */
#define SF_NOTCHAR 2 /* 0 - Scan code is a character */
/* 1 - Scan code is not a character; */
/* instead it is an extended key code from the keyboard. */
#define SF_IMMEDIATE 32 /* If set to 1, immediate conversion requested */
#define SF_TYPEMASK 192 /* Has the following values: */
/* 00 - Undefined */
/* 01 - Final character; interim character flag is turned off */
/* 10 - Interim character */
/* 11 - Final character; interim character flag is turned on. */
/* MonFlagWord */
#define MF_OPEN 1 // open
#define MF_CLOSE 2 // close
#define MF_FLUSH 4 // is flush packet
#define MF_OPEN 1 /* open */
#define MF_CLOSE 2 /* close */
#define MF_FLUSH 4 /* is flush packet */
// KbdDDFlagWord
/* KbdDDFlagWord */
#define KF_NOTSQPACKET 1024 // Don't put this packet in SQ buffer
#define KF_ACCENTEDKEY 512 // Key was translated using previous accent.
#define KF_MULTIMAKE 256 // Key was repeated make of a toggle key.
#define KF_SECONDARYKEY 128 // Previous scan code was the E0 prefix code.
#define KF_KEYBREAK 64 // This is the break of the key.
#define KF_KEYTYPEMASK 63 // Isolates the Key Type field of DDFlags.
#define KF_UNDEFKEY 63 // Key packet is undefined
#define KF_SYSREQKEY 23 // This key packet is the SysReq key (4990)
#define KF_PRINTFLUSHKEY 22 // This packet is Ct-Alt-PrtScr
#define KF_PSPRINTECHOKEY 21 // This packet is Ctl-P
#define KF_PRINTECHOKEY 20 // This packet is Ctl-PrtScr
#define KF_PRTSCRKEY 19 // This packet is PrtScr
#define KF_PSBREAKKEY 18 // This packet is Ctl-C
#define KF_BREAKKEY 17 // This packet is Ctl-Break
#define KF_ACCENTKEY 16 // This packet is an accent key
#define KF_XRORPNOT 13 // This packet is a Read or Peek Notification Pct.
#define KF_MLNOTIFICATION 14 // packet is a Multi-Layer NLS packet
#define KF_HOTKEYPACKET 12 // This packet is the hot key.
#define KF_BADKEYCOMBO 11 // Accent/char combo undefined, beep only.
#define KF_WAKEUPKEY 10 // This packet is one following PAUSEKEY
#define KF_PSPAUSEKEY 9 // This packet is Ctl-S
#define KF_PAUSEKEY 8 // This packet is Ctl-Numlock or PAUSE
#define KF_SHIFTMASK 7 // Key is a shift Key
#define KF_DUMPKEY 6 // This packet is Ctl-Numlock-NumLock
#define KF_REBOOTKEY 5 // This packet is Ctl-Alt-Del
#define KF_RESENDCODE 4 // This packet is resend code from controller
#define KF_OVERRUNCODE 3 // This packet is overrun code from controller
#define KF_SECPREFIXCODE 2 // This packet is E0/E1 scan code
#define KF_ACKCODE 1 // This packet is ack code from keyboard
#define KF_NOTSQPACKET 1024 /* Don't put this packet in SQ buffer */
#define KF_ACCENTEDKEY 512 /* Key was translated using previous accent. */
#define KF_MULTIMAKE 256 /* Key was repeated make of a toggle key. */
#define KF_SECONDARYKEY 128 /* Previous scan code was the E0 prefix code. */
#define KF_KEYBREAK 64 /* This is the break of the key. */
#define KF_KEYTYPEMASK 63 /* Isolates the Key Type field of DDFlags. */
#define KF_UNDEFKEY 63 /* Key packet is undefined */
#define KF_SYSREQKEY 23 /* This key packet is the SysReq key (4990) */
#define KF_PRINTFLUSHKEY 22 /* This packet is Ct-Alt-PrtScr */
#define KF_PSPRINTECHOKEY 21 /* This packet is Ctl-P */
#define KF_PRINTECHOKEY 20 /* This packet is Ctl-PrtScr */
#define KF_PRTSCRKEY 19 /* This packet is PrtScr */
#define KF_PSBREAKKEY 18 /* This packet is Ctl-C */
#define KF_BREAKKEY 17 /* This packet is Ctl-Break */
#define KF_ACCENTKEY 16 /* This packet is an accent key */
#define KF_XRORPNOT 13 /* This packet is a Read or Peek Notification Pct. */
#define KF_MLNOTIFICATION 14 /* packet is a Multi-Layer NLS packet */
#define KF_HOTKEYPACKET 12 /* This packet is the hot key. */
#define KF_BADKEYCOMBO 11 /* Accent/char combo undefined, beep only. */
#define KF_WAKEUPKEY 10 /* This packet is one following PAUSEKEY */
#define KF_PSPAUSEKEY 9 /* This packet is Ctl-S */
#define KF_PAUSEKEY 8 /* This packet is Ctl-Numlock or PAUSE */
#define KF_SHIFTMASK 7 /* Key is a shift Key */
#define KF_DUMPKEY 6 /* This packet is Ctl-Numlock-NumLock */
#define KF_REBOOTKEY 5 /* This packet is Ctl-Alt-Del */
#define KF_RESENDCODE 4 /* This packet is resend code from controller */
#define KF_OVERRUNCODE 3 /* This packet is overrun code from controller */
#define KF_SECPREFIXCODE 2 /* This packet is E0/E1 scan code */
#define KF_ACKCODE 1 /* This packet is ack code from keyboard */
typedef struct _MONBUF {
@ -120,29 +120,29 @@ typedef struct _MONBUF {
BYTE Reserved[20];
} MONBUF;
#define RS_SYSREG 32768 // Bit 15 SysReq key down
#define RS_CAPSLOCK 16384 // Bit 14 Caps Lock key down
#define RS_NUMLOCK 8192 // Bit 13 NumLock key down
#define RS_SCROLLLOCK 4096 // Bit 12 Scroll Lock key down
#define RS_RALT 2048 // Bit 11 Right Alt key down
#define RS_RCONTROL 1024 // Bit 10 Right Ctrl key down
#define RS_LALT 512 // Bit 9 Left Alt key down
#define RS_LCONTROL 256 // Bit 8 Left Ctrl key down
#define RS_INSERT 128 // Bit 7 Insert on
#define RS_CAPS 64 // Bit 6 Caps Lock on
#define RS_NUM 32 // Bit 5 NumLock on
#define RS_SCROLL 16 // Bit 4 Scroll Lock on
#define RS_ALT 8 // Bit 3 Either Alt key down
#define RS_CONTROL 4 // Bit 2 Either Ctrl key down
#define RS_LSHIFT 2 // Bit 1 Left Shift key down
#define RS_RSHIFT 1 // Bit 0 Right Shift key down
#define RS_SYSREG 32768 /* Bit 15 SysReq key down */
#define RS_CAPSLOCK 16384 /* Bit 14 Caps Lock key down */
#define RS_NUMLOCK 8192 /* Bit 13 NumLock key down */
#define RS_SCROLLLOCK 4096 /* Bit 12 Scroll Lock key down */
#define RS_RALT 2048 /* Bit 11 Right Alt key down */
#define RS_RCONTROL 1024 /* Bit 10 Right Ctrl key down */
#define RS_LALT 512 /* Bit 9 Left Alt key down */
#define RS_LCONTROL 256 /* Bit 8 Left Ctrl key down */
#define RS_INSERT 128 /* Bit 7 Insert on */
#define RS_CAPS 64 /* Bit 6 Caps Lock on */
#define RS_NUM 32 /* Bit 5 NumLock on */
#define RS_SCROLL 16 /* Bit 4 Scroll Lock on */
#define RS_ALT 8 /* Bit 3 Either Alt key down */
#define RS_CONTROL 4 /* Bit 2 Either Ctrl key down */
#define RS_LSHIFT 2 /* Bit 1 Left Shift key down */
#define RS_RSHIFT 1 /* Bit 0 Right Shift key down */
#define CS_RCONTROL 91 // Right Control
#define CS_LSHIFT 42 // Left Shift
#define CS_RSHIFT 54 // Right Shift
#define CS_LALT 56 // Left Alt
#define CS_RALT 94 // Right Alt
#define CS_RCONTROL 91 /* Right Control */
#define CS_LSHIFT 42 /* Left Shift */
#define CS_RSHIFT 54 /* Right Shift */
#define CS_LALT 56 /* Left Alt */
#define CS_RALT 94 /* Right Alt */
/* DosMon* prototypes */

View File

@ -39,4 +39,3 @@
#include "os2/mon.h"
void __PM_checkConsoleSwitch(void);

View File

@ -116,16 +116,16 @@ typedef struct _VIDEO_ADAPTER {
/* PMIREQUEST_SOFTWAREINT structures from OS/2 DDK */
typedef struct {
ULONG ulFlags; // VDM initialization type
#define VDM_POSTLOAD 0x1 // adapter just loaded, used internally for initialization
#define VDM_INITIALIZE 0x2 // force initialization of a permanently open VDM, even if previously initialized
#define VDM_TERMINATE_POSTINITIALIZE 0x6 //start VDM with initialization, but close it afterwards (includes VDM_INITIALIZE)
#define VDM_QUERY_CAPABILITY 0x10 // query the current int 10 capability
#define VDM_FULL_VDM_CREATED 0x20 // a full VDM is created
#define VDM_MINI_VDM_CREATED 0x40 // a mini VDM is created
#define VDM_MINI_VDM_SUPPORTED 0x80 // mini VDM support is available
PCHAR szName; // VDM initialization program
PCHAR szArgs; // VDM initialization arguments
ULONG ulFlags; /* VDM initialization type */
#define VDM_POSTLOAD 0x1 /* adapter just loaded, used internally for initialization */
#define VDM_INITIALIZE 0x2 /* force initialization of a permanently open VDM, even if previously initialized */
#define VDM_TERMINATE_POSTINITIALIZE 0x6 /*start VDM with initialization, but close it afterwards (includes VDM_INITIALIZE) */
#define VDM_QUERY_CAPABILITY 0x10 /* query the current int 10 capability */
#define VDM_FULL_VDM_CREATED 0x20 /* a full VDM is created */
#define VDM_MINI_VDM_CREATED 0x40 /* a mini VDM is created */
#define VDM_MINI_VDM_SUPPORTED 0x80 /* mini VDM support is available */
PCHAR szName; /* VDM initialization program */
PCHAR szArgs; /* VDM initialization arguments */
}INITVDM;
typedef struct {
@ -218,7 +218,7 @@ typedef struct _SESWITCHREC {
HEV Event; /* Posted after callback is called */
} SESWITCHREC;
// Page sized block cache
/* Page sized block cache */
#define PAGES_PER_BLOCK 32
#define PAGE_BLOCK_SIZE (PAGES_PER_BLOCK * PM_PAGE_SIZE + (PM_PAGE_SIZE-1) + sizeof(pageblock))
@ -726,7 +726,7 @@ Set the suspend application callback for the fullscreen console.
void PMAPI PM_setSuspendAppCallback(
PM_saveState_cb saveState)
{
// If PM isn't loaded, this stuff will cause crashes!
/* If PM isn't loaded, this stuff will cause crashes! */
if (__isShellLoaded()) {
if (saveState) {
/* Create the threads responsible for tracking console switches */
@ -813,7 +813,7 @@ ibool PMAPI PM_setRealTimeClockHandler(
PM_intHandler ih,
int frequency)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)ih;
(void)frequency;
return false;
@ -826,7 +826,7 @@ Set the real time clock frequency (for stereo modes).
void PMAPI PM_setRealTimeClockFrequency(
int frequency)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)frequency;
}
@ -836,7 +836,7 @@ Restore the original real time clock handler.
****************************************************************************/
void PMAPI PM_restoreRealTimeClockHandler(void)
{
// TODO: Implement this!
/* TODO: Implement this! */
}
/****************************************************************************
@ -1625,8 +1625,8 @@ int PMAPI PM_enableWriteCombine(
return MTRR_enableWriteCombine(base,size,type);
}
// TODO: Move the MTRR helper stuff into the call gate, or better yet
// entirely into the ring 0 helper driver!!
/* TODO: Move the MTRR helper stuff into the call gate, or better yet */
/* entirely into the ring 0 helper driver!! */
/* MTRR helper functions. To make it easier to implement the MTRR support
* under OS/2, we simply put our ring 0 helper functions into the
@ -1705,7 +1705,7 @@ void _ASMAPI _MTRR_writeMSR(
PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName)
{
// TODO: Implement this to load shared libraries!
/* TODO: Implement this to load shared libraries! */
(void)szDLLName;
return NULL;
}
@ -1714,7 +1714,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule,
const char *szProcName)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
(void)szProcName;
return NULL;
@ -1723,7 +1723,7 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary(
PM_MODULE hModule)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
}

View File

@ -59,7 +59,7 @@ Pumps all messages in the message queue from OS/2 into our event queue.
****************************************************************************/
static void _EVT_pumpMessages(void)
{
// TODO: Implement this for OS/2 Presentation Manager apps!
/* TODO: Implement this for OS/2 Presentation Manager apps! */
}
/****************************************************************************
@ -105,7 +105,7 @@ void EVTAPI EVT_init(
oldKeyMessage = 0;
memset(keyUpMsg,0,sizeof(keyUpMsg));
// TODO: OS/2 PM specific initialisation code!
/* TODO: OS/2 PM specific initialisation code! */
/* Catch program termination signals so we can clean up properly */
signal(SIGABRT, _EVT_abort);
@ -135,7 +135,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for OS/2
/* Do nothing for OS/2 */
}
/****************************************************************************
@ -145,7 +145,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for OS/2
/* Do nothing for OS/2 */
}
/****************************************************************************
@ -159,7 +159,7 @@ void EVT_exit(void)
signal(SIGFPE, SIG_DFL);
signal(SIGINT, SIG_DFL);
// TODO: OS/2 PM specific exit code
/* TODO: OS/2 PM specific exit code */
}
/****************************************************************************

View File

@ -230,8 +230,8 @@ void EVTAPI EVT_setMouseRange(
int xRes,
int yRes)
{
// TODO: Need to call Input to change the coordinates that it returns
// for mouse events!!
/* TODO: Need to call Input to change the coordinates that it returns */
/* for mouse events!! */
}
/****************************************************************************
@ -242,7 +242,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for Photon
/* Do nothing for Photon */
}
/****************************************************************************
@ -252,7 +252,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for Photon
/* Do nothing for Photon */
}
/****************************************************************************

View File

@ -37,7 +37,7 @@
#ifndef __QNXNTO__
static struct _mouse_ctrl *_PM_mouse_ctl;
static int _PM_keyboard_fd = -1;
//static int _PM_modifiers, _PM_leds;
/*static int _PM_modifiers, _PM_leds; */
#else
static int kbd_fd = -1, mouse_fd = -1;
#endif
@ -58,7 +58,7 @@ typedef struct {
int map;
} keymap;
// TODO: Fix this and set it up so we can do a binary search!
/* TODO: Fix this and set it up so we can do a binary search! */
keymap keymaps[] = {
{96, KB_padEnter},
@ -146,8 +146,8 @@ Converts a mickey movement value to a pixel adjustment value.
static int MickeyToPixel(
int mickey)
{
// TODO: We can add some code in here to handle 'acceleration' for
// the mouse cursor. For now just use the mickeys.
/* TODO: We can add some code in here to handle 'acceleration' for */
/* the mouse cursor. For now just use the mickeys. */
return mickey;
}
@ -532,7 +532,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for QNX
/* Do nothing for QNX */
}
/****************************************************************************
@ -542,7 +542,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for QNX
/* Do nothing for QNX */
}
/****************************************************************************
@ -599,4 +599,3 @@ void EVT_exit(void)
kill_pid = 0;
}
}

View File

@ -75,7 +75,7 @@ Return true if ring 0 (or if we can call the helpers functions at ring 0)
ibool _ASMAPI _MTRR_isRing0(void)
{
#ifdef __QNXNTO__
return false; // Not implemented yet!
return false; /* Not implemented yet! */
#else
return true;
#endif

View File

@ -320,18 +320,18 @@ void PM_setOSScreenWidth(int width,int height)
ibool PMAPI PM_setRealTimeClockHandler(PM_intHandler ih, int frequency)
{
// TODO: Implement this for QNX
/* TODO: Implement this for QNX */
return false;
}
void PMAPI PM_setRealTimeClockFrequency(int frequency)
{
// TODO: Implement this for QNX
/* TODO: Implement this for QNX */
}
void PMAPI PM_restoreRealTimeClockHandler(void)
{
// TODO: Implement this for QNX
/* TODO: Implement this for QNX */
}
char * PMAPI PM_getCurrentPath(
@ -504,8 +504,8 @@ void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
ulong PMAPI PM_getPhysicalAddr(void *p)
{
// TODO: This function should find the physical address of a linear
// address.
/* TODO: This function should find the physical address of a linear */
/* address. */
return 0xFFFFFFFFUL;
}
@ -514,19 +514,19 @@ ibool PMAPI PM_getPhysicalAddrRange(
ulong length,
ulong *physAddress)
{
// TODO: Implement this!
/* TODO: Implement this! */
return false;
}
void PMAPI PM_sleep(ulong milliseconds)
{
// TODO: Put the process to sleep for milliseconds
/* TODO: Put the process to sleep for milliseconds */
}
int PMAPI PM_getCOMPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3F8;
case 1: return 0x2F8;
@ -536,8 +536,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3BC;
case 1: return 0x378;
@ -730,7 +730,7 @@ void * PMAPI PM_allocLockedMem(
ibool contiguous,
ibool below16M)
{
// TODO: Implement this on QNX
/* TODO: Implement this on QNX */
return NULL;
}
@ -739,20 +739,20 @@ void PMAPI PM_freeLockedMem(
uint size,
ibool contiguous)
{
// TODO: Implement this on QNX
/* TODO: Implement this on QNX */
}
void * PMAPI PM_allocPage(
ibool locked)
{
// TODO: Implement this on QNX
/* TODO: Implement this on QNX */
return NULL;
}
void PMAPI PM_freePage(
void *p)
{
// TODO: Implement this on QNX
/* TODO: Implement this on QNX */
}
void PMAPI PM_setBankA(int bank)
@ -837,7 +837,7 @@ int PMAPI PM_unlockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName)
{
// TODO: Implement this to load shared libraries!
/* TODO: Implement this to load shared libraries! */
(void)szDLLName;
return NULL;
}
@ -846,7 +846,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule,
const char *szProcName)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
(void)szProcName;
return NULL;
@ -855,14 +855,14 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary(
PM_MODULE hModule)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
}
int PMAPI PM_setIOPL(
int level)
{
// QNX handles IOPL selection at the program link level.
/* QNX handles IOPL selection at the program link level. */
return level;
}

View File

@ -261,7 +261,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for Win32
/* Do nothing for Win32 */
}
/****************************************************************************
@ -271,7 +271,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for Win32
/* Do nothing for Win32 */
}
/****************************************************************************

View File

@ -59,7 +59,7 @@ Initialise the PM library.
****************************************************************************/
void PMAPI PM_init(void)
{
// TODO: dO any special init code in here.
/* TODO: dO any special init code in here. */
MTRR_init();
}
@ -114,8 +114,8 @@ void PMAPI PM_fatalError(
{
if (fatalErrorCleanup)
fatalErrorCleanup();
// TODO: Display a fatal error message and exit!
// MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION);
/* TODO: Display a fatal error message and exit! */
/* MessageBox(NULL,msg,"Fatal Error!", MB_ICONEXCLAMATION); */
exit(1);
}
@ -138,7 +138,7 @@ Check if a key has been pressed.
****************************************************************************/
int PMAPI PM_kbhit(void)
{
// TODO: Need to check if a key is waiting on the keyboard queue
/* TODO: Need to check if a key is waiting on the keyboard queue */
return true;
}
@ -148,7 +148,7 @@ Wait for and return the next keypress.
****************************************************************************/
int PMAPI PM_getch(void)
{
// TODO: Need to obtain the next keypress, and block until one is hit
/* TODO: Need to obtain the next keypress, and block until one is hit */
return 0xD;
}
@ -240,7 +240,7 @@ Return the path to the Nucleus driver files.
****************************************************************************/
const char * PMAPI PM_getNucleusPath(void)
{
// TODO: Point this at the path when the Nucleus drivers will be found
/* TODO: Point this at the path when the Nucleus drivers will be found */
return "c:\\nucleus";
}
@ -307,7 +307,7 @@ void * PMAPI PM_mapPhysicalAddr(
ulong limit,
ibool isCached)
{
// TODO: Map a physical memory address to a linear address
/* TODO: Map a physical memory address to a linear address */
return NULL;
}
@ -319,13 +319,13 @@ void PMAPI PM_freePhysicalAddr(
void *ptr,
ulong limit)
{
// TODO: Free the physical address mapping
/* TODO: Free the physical address mapping */
}
ulong PMAPI PM_getPhysicalAddr(void *p)
{
// TODO: This function should find the physical address of a linear
// address.
/* TODO: This function should find the physical address of a linear */
/* address. */
return 0xFFFFFFFFUL;
}
@ -336,8 +336,8 @@ void PMAPI PM_sleep(ulong milliseconds)
int PMAPI PM_getCOMPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3F8;
case 1: return 0x2F8;
@ -347,8 +347,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3BC;
case 1: return 0x378;
@ -484,8 +484,8 @@ void PMAPI PM_availableMemory(
ulong *physical,
ulong *total)
{
// TODO: Figure out how to determine the available memory. Not entirely
// critical so returning 0 is OK.
/* TODO: Figure out how to determine the available memory. Not entirely */
/* critical so returning 0 is OK. */
*physical = *total = 0;
}
@ -499,7 +499,7 @@ void * PMAPI PM_allocLockedMem(
ibool contiguous,
ibool below16M)
{
// TODO: Allocate a block of locked, phsyically contigous memory for DMA
/* TODO: Allocate a block of locked, phsyically contigous memory for DMA */
return 0;
}
@ -513,7 +513,7 @@ void PMAPI PM_freeLockedMem(
ibool contiguous)
{
// TODO: Free a locked memory buffer
/* TODO: Free a locked memory buffer */
}
/****************************************************************************
@ -564,7 +564,7 @@ ibool PMAPI PM_doBIOSPOST(
PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName)
{
// TODO: Implement this to load shared libraries!
/* TODO: Implement this to load shared libraries! */
(void)szDLLName;
return NULL;
}
@ -573,7 +573,7 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule,
const char *szProcName)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
(void)szProcName;
return NULL;
@ -582,7 +582,7 @@ void * PMAPI PM_getProcAddress(
void PMAPI PM_freeLibrary(
PM_MODULE hModule)
{
// TODO: Implement this!
/* TODO: Implement this! */
(void)hModule;
}
@ -594,9 +594,9 @@ ulong PMAPI PM_findFirstFile(
const char *filename,
PM_findData *findData)
{
// TODO: This function should start a directory enumeration search
// given the filename (with wildcards). The data should be
// converted and returned in the findData standard form.
/* TODO: This function should start a directory enumeration search */
/* given the filename (with wildcards). The data should be */
/* converted and returned in the findData standard form. */
(void)filename;
(void)findData;
return PM_FILE_INVALID;
@ -610,10 +610,10 @@ ibool PMAPI PM_findNextFile(
ulong handle,
PM_findData *findData)
{
// TODO: This function should find the next file in directory enumeration
// search given the search criteria defined in the call to
// PM_findFirstFile. The data should be converted and returned
// in the findData standard form.
/* TODO: This function should find the next file in directory enumeration */
/* search given the search criteria defined in the call to */
/* PM_findFirstFile. The data should be converted and returned */
/* in the findData standard form. */
(void)handle;
(void)findData;
return false;
@ -626,8 +626,8 @@ Function to close the find process
void PMAPI PM_findClose(
ulong handle)
{
// TODO: This function should close the find process. This may do
// nothing for some OS'es.
/* TODO: This function should close the find process. This may do */
/* nothing for some OS'es. */
(void)handle;
}
@ -675,7 +675,7 @@ void PMAPI PM_setFileAttr(
const char *filename,
uint attrib)
{
// TODO: Set the file attributes for a file
/* TODO: Set the file attributes for a file */
(void)filename;
(void)attrib;
}

View File

@ -140,8 +140,8 @@ and we call the addMouseEvent() routine to add the appropriate mouse event
to the event queue.
Note: Interrupts are ON when this routine is called by the mouse driver code.
//AM: NOTE: This function has not actually been ported from DOS yet and should not
//AM: be installed until it is.
/*AM: NOTE: This function has not actually been ported from DOS yet and should not */
/*AM: be installed until it is. */
****************************************************************************/
static void EVTAPI mouseISR(
uint mask,

View File

@ -165,8 +165,8 @@ void PMAPI PM_fatalError(const char *msg)
if (fatalErrorCleanup)
fatalErrorCleanup();
MGLOutput(msg);
// No support for fprintf() under smx currently!
// fprintf(stderr,"%s\n", msg);
/* No support for fprintf() under smx currently! */
/* fprintf(stderr,"%s\n", msg); */
exit(1);
}
@ -614,9 +614,9 @@ ibool PMAPI PM_driveValid(
{
RMREGS regs;
regs.h.dl = (uchar)(drive - 'A' + 1);
regs.h.ah = 0x36; // Get disk information service
regs.h.ah = 0x36; /* Get disk information service */
PM_int86(0x21,&regs,&regs);
return regs.x.ax != 0xFFFF; // AX = 0xFFFF if disk is invalid
return regs.x.ax != 0xFFFF; /* AX = 0xFFFF if disk is invalid */
}
/****************************************************************************
@ -682,7 +682,7 @@ ibool PMAPI PM_mkdir(
#ifdef __GNUC__
return mkdir(filename,S_IRUSR) == 0;
#else
//AM: return mkdir(filename) == 0;
/*AM: return mkdir(filename) == 0; */
return(false);
#endif
}
@ -694,7 +694,7 @@ Function to remove a directory.
ibool PMAPI PM_rmdir(
const char *filename)
{
//AM: return rmdir(filename) == 0;
/*AM: return rmdir(filename) == 0; */
return(false);
}
@ -1003,8 +1003,8 @@ void PMAPI PM_freePhysicalAddr(void *ptr,ulong limit)
ulong PMAPI PM_getPhysicalAddr(void *p)
{
// TODO: This function should find the physical address of a linear
// address.
/* TODO: This function should find the physical address of a linear */
/* address. */
(void)p;
return 0xFFFFFFFFUL;
}
@ -1086,8 +1086,8 @@ int PMAPI PM_int86(int intno, RMREGS *in, RMREGS *out)
memset(&rmregs, 0, sizeof(rmregs));
IN(eax); IN(ebx); IN(ecx); IN(edx); IN(esi); IN(edi);
// These real mode ints may cause crashes.
//AM: DPMI_int86(intno,&rmregs); /* DPMI issue real interrupt */
/* These real mode ints may cause crashes. */
/*AM: DPMI_int86(intno,&rmregs); /###* DPMI issue real interrupt */
OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
out->x.cflag = rmregs.flags & 0x1;
@ -1104,7 +1104,7 @@ int PMAPI PM_int86x(int intno, RMREGS *in, RMREGS *out,
rmregs.es = sregs->es;
rmregs.ds = sregs->ds;
//AM: DPMI_int86(intno,&rmregs); /* DPMI issue real interrupt */
/*AM: DPMI_int86(intno,&rmregs); /###* DPMI issue real interrupt */
OUT(eax); OUT(ebx); OUT(ecx); OUT(edx); OUT(esi); OUT(edi);
sregs->es = rmregs.es;
@ -1156,7 +1156,7 @@ Function to get the file attributes for a specific file.
uint PMAPI PM_getFileAttr(
const char *filename)
{
// TODO: Implement this!
/* TODO: Implement this! */
return 0;
}
@ -1169,7 +1169,7 @@ ibool PMAPI PM_getFileTime(
ibool gmTime,
PM_time *time)
{
// TODO: Implement this!
/* TODO: Implement this! */
return false;
}
@ -1182,6 +1182,6 @@ ibool PMAPI PM_setFileTime(
ibool gmTime,
PM_time *time)
{
// TODO: Implement this!
/* TODO: Implement this! */
return false;
}

View File

@ -457,9 +457,9 @@ int PMAPI PM_lockCodePages(void (*p)(),uint len,PM_lockHandle *lh)
{
PMSREGS sregs;
PM_segread(&sregs);
//AM: causes minor glitch with
//AM: older versions pmEasy which don't allow DPMI 06 on
//AM: Code selector 0x0C -- assume base is 0 which it should be.
/*AM: causes minor glitch with */
/*AM: older versions pmEasy which don't allow DPMI 06 on */
/*AM: Code selector 0x0C -- assume base is 0 which it should be. */
return DPMI_lockLinearPages((uint)p,len);
}

View File

@ -37,8 +37,8 @@ Increase the thread priority to maximum, if possible.
****************************************************************************/
static int SetMaxThreadPriority(void)
{
// TODO: If you have thread priorities, increase it to maximum for the
// thread for timing the CPU frequency.
/* TODO: If you have thread priorities, increase it to maximum for the */
/* thread for timing the CPU frequency. */
return oldPriority;
}
@ -49,7 +49,7 @@ Restore the original thread priority.
static void RestoreThreadPriority(
int priority)
{
// TODO: Restore the original thread priority on exit.
/* TODO: Restore the original thread priority on exit. */
}
/****************************************************************************
@ -59,8 +59,8 @@ Initialise the counter and return the frequency of the counter.
static void GetCounterFrequency(
CPU_largeInteger *freq)
{
// TODO: Return the frequency of the counter in here. You should try to
// normalise this value to be around 100,000 ticks per second.
/* TODO: Return the frequency of the counter in here. You should try to */
/* normalise this value to be around 100,000 ticks per second. */
freq->low = 0;
freq->high = 0;
}

View File

@ -59,7 +59,7 @@ events.
****************************************************************************/
ulong _EVT_getTicks(void)
{
// TODO: Implement this for your OS!
/* TODO: Implement this for your OS! */
}
/****************************************************************************
@ -68,36 +68,36 @@ Pumps all messages in the application message queue into our event queue.
****************************************************************************/
static void _EVT_pumpMessages(void)
{
// TODO: The purpose of this function is to read all keyboard and mouse
// events from the OS specific event queue, translate them and post
// them into the SciTech event queue.
//
// NOTE: There are a couple of important things that this function must
// take care of:
//
// 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required.
//
// 2. Support for reading hardware scan code as well as ASCII
// translated values is required. Games use the scan codes rather
// than ASCII values. Scan codes go into the high order byte of the
// keyboard message field.
//
// 3. Support for at least reading mouse motion data (mickeys) from the
// mouse is required. Using the mickey values, we can then translate
// to mouse cursor coordinates scaled to the range of the current
// graphics display mode. Mouse values are scaled based on the
// global 'rangeX' and 'rangeY'.
//
// 4. Support for a timestamp for the events is required, which is
// defined as the number of milliseconds since some event (usually
// system startup). This is the timestamp when the event occurred
// (ie: at interrupt time) not when it was stuff into the SciTech
// event queue.
//
// 5. Support for mouse double click events. If the OS has a native
// mechanism to determine this, it should be used. Otherwise the
// time stamp information will be used by the generic event code
// to generate double click events.
/* TODO: The purpose of this function is to read all keyboard and mouse */
/* events from the OS specific event queue, translate them and post */
/* them into the SciTech event queue. */
/* */
/* NOTE: There are a couple of important things that this function must */
/* take care of: */
/* */
/* 1. Support for KEYDOWN, KEYREPEAT and KEYUP is required. */
/* */
/* 2. Support for reading hardware scan code as well as ASCII */
/* translated values is required. Games use the scan codes rather */
/* than ASCII values. Scan codes go into the high order byte of the */
/* keyboard message field. */
/* */
/* 3. Support for at least reading mouse motion data (mickeys) from the */
/* mouse is required. Using the mickey values, we can then translate */
/* to mouse cursor coordinates scaled to the range of the current */
/* graphics display mode. Mouse values are scaled based on the */
/* global 'rangeX' and 'rangeY'. */
/* */
/* 4. Support for a timestamp for the events is required, which is */
/* defined as the number of milliseconds since some event (usually */
/* system startup). This is the timestamp when the event occurred */
/* (ie: at interrupt time) not when it was stuff into the SciTech */
/* event queue. */
/* */
/* 5. Support for mouse double click events. If the OS has a native */
/* mechanism to determine this, it should be used. Otherwise the */
/* time stamp information will be used by the generic event code */
/* to generate double click events. */
}
/****************************************************************************
@ -141,7 +141,7 @@ void EVTAPI EVT_init(
initEventQueue();
memset(keyUpMsg,0,sizeof(keyUpMsg));
// TODO: Do any OS specific initialisation here
/* TODO: Do any OS specific initialisation here */
/* Catch program termination signals so we can clean up properly */
signal(SIGABRT, _EVT_abort);
@ -171,7 +171,7 @@ and this function can be used to resume it again later.
****************************************************************************/
void EVT_resume(void)
{
// Do nothing for non DOS systems
/* Do nothing for non DOS systems */
}
/****************************************************************************
@ -181,7 +181,7 @@ de-install the event handling code.
****************************************************************************/
void EVT_suspend(void)
{
// Do nothing for non DOS systems
/* Do nothing for non DOS systems */
}
/****************************************************************************
@ -195,5 +195,5 @@ void EVT_exit(void)
signal(SIGFPE, SIG_DFL);
signal(SIGINT, SIG_DFL);
// TODO: Do any OS specific cleanup in here
/* TODO: Do any OS specific cleanup in here */
}

View File

@ -28,6 +28,6 @@
*
****************************************************************************/
// TODO: This is where you include OS specific headers for the event handling
// library. You may leave this empty if you have no OS specific headers
// to include.
/* TODO: This is where you include OS specific headers for the event handling */
/* library. You may leave this empty if you have no OS specific headers */
/* to include. */

View File

@ -38,13 +38,13 @@
#include <stdlib.h>
#include <string.h>
// TODO: Include any OS specific headers here!
/* TODO: Include any OS specific headers here! */
/*--------------------------- Global variables ----------------------------*/
// TODO: If you support access to the BIOS, the following VESABuf globals
// keep track of a single VESA transfer buffer. If you don't support
// access to the BIOS, remove these variables.
/* TODO: If you support access to the BIOS, the following VESABuf globals */
/* keep track of a single VESA transfer buffer. If you don't support */
/* access to the BIOS, remove these variables. */
static uint VESABuf_len = 1024; /* Length of the VESABuf buffer */
static void *VESABuf_ptr = NULL; /* Near pointer to VESABuf */
@ -61,12 +61,12 @@ Initialise the PM library.
****************************************************************************/
void PMAPI PM_init(void)
{
// TODO: Do any initialisation in here. This includes getting IOPL
// access for the process calling PM_init. This will get called
// more than once.
/* TODO: Do any initialisation in here. This includes getting IOPL */
/* access for the process calling PM_init. This will get called */
/* more than once. */
// TODO: If you support the supplied MTRR register stuff (you need to
// be at ring 0 for this!), you should initialise it in here.
/* TODO: If you support the supplied MTRR register stuff (you need to */
/* be at ring 0 for this!), you should initialise it in here. */
/* MTRR_init(); */
}
@ -77,7 +77,7 @@ Return the operating system type identifier.
****************************************************************************/
long PMAPI PM_getOSType(void)
{
// TODO: Change this to return the define for your OS from drvlib/os.h
/* TODO: Change this to return the define for your OS from drvlib/os.h */
return _OS_MYOS;
}
@ -119,9 +119,9 @@ Report a fatal error condition and halt the program.
void PMAPI PM_fatalError(
const char *msg)
{
// TODO: If you are running in a GUI environment without a console,
// this needs to be changed to bring up a fatal error message
// box and terminate the program.
/* TODO: If you are running in a GUI environment without a console, */
/* this needs to be changed to bring up a fatal error message */
/* box and terminate the program. */
if (fatalErrorCleanup)
fatalErrorCleanup();
fprintf(stderr,"%s\n", msg);
@ -134,7 +134,7 @@ Exit handler to kill the VESA transfer buffer.
****************************************************************************/
static void ExitVBEBuf(void)
{
// TODO: If you do not have BIOS access, remove this function.
/* TODO: If you do not have BIOS access, remove this function. */
if (VESABuf_ptr)
PM_freeRealSeg(VESABuf_ptr);
VESABuf_ptr = 0;
@ -149,8 +149,8 @@ void * PMAPI PM_getVESABuf(
uint *rseg,
uint *roff)
{
// TODO: If you do not have BIOS access, simply delete the guts of
// this function and return NULL.
/* TODO: If you do not have BIOS access, simply delete the guts of */
/* this function and return NULL. */
if (!VESABuf_ptr) {
/* Allocate a global buffer for communicating with the VESA VBE */
if ((VESABuf_ptr = PM_allocRealSeg(VESABuf_len, &VESABuf_rseg, &VESABuf_roff)) == NULL)
@ -169,9 +169,9 @@ Check if a key has been pressed.
****************************************************************************/
int PMAPI PM_kbhit(void)
{
// TODO: This function checks if a key is available to be read. This
// should be implemented, but is mostly used by the test programs
// these days.
/* TODO: This function checks if a key is available to be read. This */
/* should be implemented, but is mostly used by the test programs */
/* these days. */
return true;
}
@ -181,9 +181,9 @@ Wait for and return the next keypress.
****************************************************************************/
int PMAPI PM_getch(void)
{
// TODO: This returns the ASCII code of the key pressed. This
// should be implemented, but is mostly used by the test programs
// these days.
/* TODO: This returns the ASCII code of the key pressed. This */
/* should be implemented, but is mostly used by the test programs */
/* these days. */
return 0xD;
}
@ -193,12 +193,12 @@ Open a fullscreen console mode for output.
****************************************************************************/
int PMAPI PM_openConsole(void)
{
// TODO: Opens up a fullscreen console for graphics output. If your
// console does not have graphics/text modes, this can be left
// empty. The main purpose of this is to disable console switching
// when in graphics modes if you can switch away from fullscreen
// consoles (if you want to allow switching, this can be done
// elsewhere with a full save/restore state of the graphics mode).
/* TODO: Opens up a fullscreen console for graphics output. If your */
/* console does not have graphics/text modes, this can be left */
/* empty. The main purpose of this is to disable console switching */
/* when in graphics modes if you can switch away from fullscreen */
/* consoles (if you want to allow switching, this can be done */
/* elsewhere with a full save/restore state of the graphics mode). */
return 0;
}
@ -208,9 +208,9 @@ Return the size of the state buffer used to save the console state.
****************************************************************************/
int PMAPI PM_getConsoleStateSize(void)
{
// TODO: Returns the size of the console state buffer used to save the
// state of the console before going into graphics mode. This is
// used to restore the console back to normal when we are done.
/* TODO: Returns the size of the console state buffer used to save the */
/* state of the console before going into graphics mode. This is */
/* used to restore the console back to normal when we are done. */
return 1;
}
@ -222,11 +222,11 @@ void PMAPI PM_saveConsoleState(
void *stateBuf,
int console_id)
{
// TODO: Saves the state of the console into the state buffer. This is
// used to restore the console back to normal when we are done.
// We will always restore 80x25 text mode after being in graphics
// mode, so if restoring text mode is all you need to do this can
// be left empty.
/* TODO: Saves the state of the console into the state buffer. This is */
/* used to restore the console back to normal when we are done. */
/* We will always restore 80x25 text mode after being in graphics */
/* mode, so if restoring text mode is all you need to do this can */
/* be left empty. */
}
/****************************************************************************
@ -237,11 +237,11 @@ void PMAPI PM_restoreConsoleState(
const void *stateBuf,
int console_id)
{
// TODO: Restore the state of the console from the state buffer. This is
// used to restore the console back to normal when we are done.
// We will always restore 80x25 text mode after being in graphics
// mode, so if restoring text mode is all you need to do this can
// be left empty.
/* TODO: Restore the state of the console from the state buffer. This is */
/* used to restore the console back to normal when we are done. */
/* We will always restore 80x25 text mode after being in graphics */
/* mode, so if restoring text mode is all you need to do this can */
/* be left empty. */
}
/****************************************************************************
@ -251,7 +251,7 @@ Close the console and return to non-fullscreen console mode.
void PMAPI PM_closeConsole(
int console_id)
{
// TODO: Close the console when we are done, going back to text mode.
/* TODO: Close the console when we are done, going back to text mode. */
}
/****************************************************************************
@ -262,8 +262,8 @@ void PM_setOSCursorLocation(
int x,
int y)
{
// TODO: Set the OS console cursor location to the new value. This is
// generally used for new OS ports (used mostly for DOS).
/* TODO: Set the OS console cursor location to the new value. This is */
/* generally used for new OS ports (used mostly for DOS). */
}
/****************************************************************************
@ -274,8 +274,8 @@ void PM_setOSScreenWidth(
int width,
int height)
{
// TODO: Set the OS console screen width. This is generally unused for
// new OS ports.
/* TODO: Set the OS console screen width. This is generally unused for */
/* new OS ports. */
}
/****************************************************************************
@ -286,12 +286,12 @@ ibool PMAPI PM_setRealTimeClockHandler(
PM_intHandler ih,
int frequency)
{
// TODO: Install a real time clock interrupt handler. Normally this
// will not be supported from most OS'es in user land, so an
// alternative mechanism is needed to enable software stereo.
// Hence leave this unimplemented unless you have a high priority
// mechanism to call the 32-bit callback when the real time clock
// interrupt fires.
/* TODO: Install a real time clock interrupt handler. Normally this */
/* will not be supported from most OS'es in user land, so an */
/* alternative mechanism is needed to enable software stereo. */
/* Hence leave this unimplemented unless you have a high priority */
/* mechanism to call the 32-bit callback when the real time clock */
/* interrupt fires. */
return false;
}
@ -302,9 +302,9 @@ Set the real time clock frequency (for stereo modes).
void PMAPI PM_setRealTimeClockFrequency(
int frequency)
{
// TODO: Set the real time clock interrupt frequency. Used for stereo
// LC shutter glasses when doing software stereo. Usually sets
// the frequency to around 2048 Hz.
/* TODO: Set the real time clock interrupt frequency. Used for stereo */
/* LC shutter glasses when doing software stereo. Usually sets */
/* the frequency to around 2048 Hz. */
}
/****************************************************************************
@ -313,7 +313,7 @@ Restore the original real time clock handler.
****************************************************************************/
void PMAPI PM_restoreRealTimeClockHandler(void)
{
// TODO: Restores the real time clock handler.
/* TODO: Restores the real time clock handler. */
}
/****************************************************************************
@ -333,8 +333,8 @@ Return the drive letter for the boot drive.
****************************************************************************/
char PMAPI PM_getBootDrive(void)
{
// TODO: Return the boot drive letter for the OS. Normally this is 'c'
// for DOS based OS'es and '/' for Unices.
/* TODO: Return the boot drive letter for the OS. Normally this is 'c' */
/* for DOS based OS'es and '/' for Unices. */
return '/';
}
@ -353,8 +353,8 @@ Return the path to the Nucleus driver files.
****************************************************************************/
const char * PMAPI PM_getNucleusPath(void)
{
// TODO: Change this to the default path to Nucleus driver files. The
// following is the default for Unices.
/* TODO: Change this to the default path to Nucleus driver files. The */
/* following is the default for Unices. */
char *env = getenv("NUCLEUS_PATH");
return env ? env : "/usr/lib/nucleus";
}
@ -378,8 +378,8 @@ Return a unique identifier for the machine if possible.
****************************************************************************/
const char * PMAPI PM_getUniqueID(void)
{
// TODO: Return a unique ID for the machine. If a unique ID is not
// available, return the machine name.
/* TODO: Return a unique ID for the machine. If a unique ID is not */
/* available, return the machine name. */
static char buf[128];
gethostname(buf, 128);
return buf;
@ -391,7 +391,7 @@ Get the name of the machine on the network.
****************************************************************************/
const char * PMAPI PM_getMachineName(void)
{
// TODO: Return the network machine name for the machine.
/* TODO: Return the network machine name for the machine. */
static char buf[128];
gethostname(buf, 128);
return buf;
@ -403,8 +403,8 @@ Return a pointer to the real mode BIOS data area.
****************************************************************************/
void * PMAPI PM_getBIOSPointer(void)
{
// TODO: This returns a pointer to the real mode BIOS data area. If you
// do not support BIOS access, you can simply return NULL here.
/* TODO: This returns a pointer to the real mode BIOS data area. If you */
/* do not support BIOS access, you can simply return NULL here. */
if (!zeroPtr)
zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF,true);
return (void*)(zeroPtr + 0x400);
@ -431,23 +431,23 @@ void * PMAPI PM_mapPhysicalAddr(
ulong limit,
ibool isCached)
{
// TODO: This function maps a physical memory address to a linear
// address in the address space of the calling process.
/* TODO: This function maps a physical memory address to a linear */
/* address in the address space of the calling process. */
// NOTE: This function *must* be able to handle any phsyical base
// address, and hence you will have to handle rounding of
// the physical base address to a page boundary (ie: 4Kb on
// x86 CPU's) to be able to properly map in the memory
// region.
/* NOTE: This function *must* be able to handle any phsyical base */
/* address, and hence you will have to handle rounding of */
/* the physical base address to a page boundary (ie: 4Kb on */
/* x86 CPU's) to be able to properly map in the memory */
/* region. */
// NOTE: If possible the isCached bit should be used to ensure that
// the PCD (Page Cache Disable) and PWT (Page Write Through)
// bits are set to disable caching for a memory mapping used
// for MMIO register access. We also disable caching using
// the MTRR registers for Pentium Pro and later chipsets so if
// MTRR support is enabled for your OS then you can safely ignore
// the isCached flag and always enable caching in the page
// tables.
/* NOTE: If possible the isCached bit should be used to ensure that */
/* the PCD (Page Cache Disable) and PWT (Page Write Through) */
/* bits are set to disable caching for a memory mapping used */
/* for MMIO register access. We also disable caching using */
/* the MTRR registers for Pentium Pro and later chipsets so if */
/* MTRR support is enabled for your OS then you can safely ignore */
/* the isCached flag and always enable caching in the page */
/* tables. */
return NULL;
}
@ -459,9 +459,9 @@ void PMAPI PM_freePhysicalAddr(
void *ptr,
ulong limit)
{
// TODO: This function will free a physical memory mapping previously
// allocated with PM_mapPhysicalAddr() if at all possible. If
// you can't free physical memory mappings, simply do nothing.
/* TODO: This function will free a physical memory mapping previously */
/* allocated with PM_mapPhysicalAddr() if at all possible. If */
/* you can't free physical memory mappings, simply do nothing. */
}
/****************************************************************************
@ -470,20 +470,20 @@ Find the physical address of a linear memory address in current process.
****************************************************************************/
ulong PMAPI PM_getPhysicalAddr(void *p)
{
// TODO: This function should find the physical address of a linear
// address.
/* TODO: This function should find the physical address of a linear */
/* address. */
return 0xFFFFFFFFUL;
}
void PMAPI PM_sleep(ulong milliseconds)
{
// TODO: Put the process to sleep for milliseconds
/* TODO: Put the process to sleep for milliseconds */
}
int PMAPI PM_getCOMPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3F8;
case 1: return 0x2F8;
@ -493,8 +493,8 @@ int PMAPI PM_getCOMPort(int port)
int PMAPI PM_getLPTPort(int port)
{
// TODO: Re-code this to determine real values using the Plug and Play
// manager for the OS.
/* TODO: Re-code this to determine real values using the Plug and Play */
/* manager for the OS. */
switch (port) {
case 0: return 0x3BC;
case 1: return 0x378;
@ -510,11 +510,11 @@ Allocate a block of (unnamed) shared memory.
void * PMAPI PM_mallocShared(
long size)
{
// TODO: This is used to allocate memory that is shared between process
// that all access the common Nucleus drivers via a common display
// driver DLL. If your OS does not support shared memory (or if
// the display driver does not need to allocate shared memory
// for each process address space), this should just call PM_malloc.
/* TODO: This is used to allocate memory that is shared between process */
/* that all access the common Nucleus drivers via a common display */
/* driver DLL. If your OS does not support shared memory (or if */
/* the display driver does not need to allocate shared memory */
/* for each process address space), this should just call PM_malloc. */
return PM_malloc(size);
}
@ -525,10 +525,10 @@ Free a block of shared memory.
void PMAPI PM_freeShared(
void *ptr)
{
// TODO: Free the shared memory block. This will be called in the context
// of the original calling process that allocated the shared
// memory with PM_mallocShared. Simply call PM_free if you do not
// need this.
/* TODO: Free the shared memory block. This will be called in the context */
/* of the original calling process that allocated the shared */
/* memory with PM_mallocShared. Simply call PM_free if you do not */
/* need this. */
PM_free(ptr);
}
@ -542,16 +542,16 @@ void * PMAPI PM_mapToProcess(
void *base,
ulong limit)
{
// TODO: This function is used to map a physical memory mapping
// previously allocated with PM_mapPhysicalAddr into the
// address space of the calling process. If the memory mapping
// allocated by PM_mapPhysicalAddr is global to all processes,
// simply return the pointer.
/* TODO: This function is used to map a physical memory mapping */
/* previously allocated with PM_mapPhysicalAddr into the */
/* address space of the calling process. If the memory mapping */
/* allocated by PM_mapPhysicalAddr is global to all processes, */
/* simply return the pointer. */
// NOTE: This function must also handle rounding to page boundaries,
// since this function is used to map in shared memory buffers
// allocated with PM_mapPhysicalAddr(). Hence if you aligned
// the physical address above, then you also need to do it here.
/* NOTE: This function must also handle rounding to page boundaries, */
/* since this function is used to map in shared memory buffers */
/* allocated with PM_mapPhysicalAddr(). Hence if you aligned */
/* the physical address above, then you also need to do it here. */
return base;
}
@ -563,9 +563,9 @@ void * PMAPI PM_mapRealPointer(
uint r_seg,
uint r_off)
{
// TODO: This function maps a real mode memory pointer into the
// calling processes address space as a 32-bit near pointer. If
// you do not support BIOS access, simply return NULL here.
/* TODO: This function maps a real mode memory pointer into the */
/* calling processes address space as a 32-bit near pointer. If */
/* you do not support BIOS access, simply return NULL here. */
if (!zeroPtr)
zeroPtr = PM_mapPhysicalAddr(0,0xFFFFF);
return (void*)(zeroPtr + MK_PHYS(r_seg,r_off));
@ -580,10 +580,10 @@ void * PMAPI PM_allocRealSeg(
uint *r_seg,
uint *r_off)
{
// TODO: This function allocates a block of real mode memory for the
// calling process used to communicate with real mode BIOS
// functions. If you do not support BIOS access, simply return
// NULL here.
/* TODO: This function allocates a block of real mode memory for the */
/* calling process used to communicate with real mode BIOS */
/* functions. If you do not support BIOS access, simply return */
/* NULL here. */
return NULL;
}
@ -594,8 +594,8 @@ Free a block of real mode memory.
void PMAPI PM_freeRealSeg(
void *mem)
{
// TODO: Frees a previously allocated real mode memory block. If you
// do not support BIOS access, this function should be empty.
/* TODO: Frees a previously allocated real mode memory block. If you */
/* do not support BIOS access, this function should be empty. */
}
/****************************************************************************
@ -606,9 +606,9 @@ void PMAPI DPMI_int86(
int intno,
DPMI_regs *regs)
{
// TODO: This function calls the real mode BIOS using the passed in
// register structure. If you do not support real mode BIOS
// access, this function should be empty.
/* TODO: This function calls the real mode BIOS using the passed in */
/* register structure. If you do not support real mode BIOS */
/* access, this function should be empty. */
}
/****************************************************************************
@ -620,9 +620,9 @@ int PMAPI PM_int86(
RMREGS *in,
RMREGS *out)
{
// TODO: This function calls the real mode BIOS using the passed in
// register structure. If you do not support real mode BIOS
// access, this function should return 0.
/* TODO: This function calls the real mode BIOS using the passed in */
/* register structure. If you do not support real mode BIOS */
/* access, this function should return 0. */
return 0;
}
@ -636,9 +636,9 @@ int PMAPI PM_int86x(
RMREGS *out,
RMSREGS *sregs)
{
// TODO: This function calls the real mode BIOS using the passed in
// register structure. If you do not support real mode BIOS
// access, this function should return 0.
/* TODO: This function calls the real mode BIOS using the passed in */
/* register structure. If you do not support real mode BIOS */
/* access, this function should return 0. */
return 0;
}
@ -652,9 +652,9 @@ void PMAPI PM_callRealMode(
RMREGS *in,
RMSREGS *sregs)
{
// TODO: This function calls a real mode far function with a far call.
// If you do not support BIOS access, this function should be
// empty.
/* TODO: This function calls a real mode far function with a far call. */
/* If you do not support BIOS access, this function should be */
/* empty. */
}
/****************************************************************************
@ -665,9 +665,9 @@ void PMAPI PM_availableMemory(
ulong *physical,
ulong *total)
{
// TODO: Report the amount of available memory, both the amount of
// physical memory left and the amount of virtual memory left.
// If the OS does not provide these services, report 0's.
/* TODO: Report the amount of available memory, both the amount of */
/* physical memory left and the amount of virtual memory left. */
/* If the OS does not provide these services, report 0's. */
*physical = *total = 0;
}
@ -681,10 +681,10 @@ void * PMAPI PM_allocLockedMem(
ibool contiguous,
ibool below16M)
{
// TODO: Allocate a block of locked, physical memory of the specified
// size. This is used for bus master operations. If this is not
// supported by the OS, return NULL and bus mastering will not
// be used.
/* TODO: Allocate a block of locked, physical memory of the specified */
/* size. This is used for bus master operations. If this is not */
/* supported by the OS, return NULL and bus mastering will not */
/* be used. */
return NULL;
}
@ -697,7 +697,7 @@ void PMAPI PM_freeLockedMem(
uint size,
ibool contiguous)
{
// TODO: Free a memory block allocated with PM_allocLockedMem.
/* TODO: Free a memory block allocated with PM_allocLockedMem. */
}
/****************************************************************************
@ -709,9 +709,9 @@ void PMAPI PM_setBankA(
{
RMREGS regs;
// TODO: This does a bank switch function by calling the real mode
// VESA BIOS. If you do not support BIOS access, this function should
// be empty.
/* TODO: This does a bank switch function by calling the real mode */
/* VESA BIOS. If you do not support BIOS access, this function should */
/* be empty. */
regs.x.ax = 0x4F05;
regs.x.bx = 0x0000;
regs.x.dx = bank;
@ -727,9 +727,9 @@ void PMAPI PM_setBankAB(
{
RMREGS regs;
// TODO: This does a bank switch function by calling the real mode
// VESA BIOS. If you do not support BIOS access, this function should
// be empty.
/* TODO: This does a bank switch function by calling the real mode */
/* VESA BIOS. If you do not support BIOS access, this function should */
/* be empty. */
regs.x.ax = 0x4F05;
regs.x.bx = 0x0000;
regs.x.dx = bank;
@ -751,9 +751,9 @@ void PMAPI PM_setCRTStart(
{
RMREGS regs;
// TODO: This changes the display start address by calling the real mode
// VESA BIOS. If you do not support BIOS access, this function
// should be empty.
/* TODO: This changes the display start address by calling the real mode */
/* VESA BIOS. If you do not support BIOS access, this function */
/* should be empty. */
regs.x.ax = 0x4F07;
regs.x.bx = waitVRT;
regs.x.cx = x;
@ -770,17 +770,17 @@ ibool PMAPI PM_enableWriteCombine(
ulong length,
uint type)
{
// TODO: This function should enable Pentium Pro and Pentium II MTRR
// write combining for the passed in physical memory base address
// and length. Normally this is done via calls to an OS specific
// device driver as this can only be done at ring 0.
//
// NOTE: This is a *very* important function to implement! If you do
// not implement, graphics performance on the latest Intel chips
// will be severly impaired. For sample code that can be used
// directly in a ring 0 device driver, see the MSDOS implementation
// which includes assembler code to do this directly (if the
// program is running at ring 0).
/* TODO: This function should enable Pentium Pro and Pentium II MTRR */
/* write combining for the passed in physical memory base address */
/* and length. Normally this is done via calls to an OS specific */
/* device driver as this can only be done at ring 0. */
/* */
/* NOTE: This is a *very* important function to implement! If you do */
/* not implement, graphics performance on the latest Intel chips */
/* will be severly impaired. For sample code that can be used */
/* directly in a ring 0 device driver, see the MSDOS implementation */
/* which includes assembler code to do this directly (if the */
/* program is running at ring 0). */
return false;
}
@ -793,19 +793,19 @@ ibool PMAPI PM_doBIOSPOST(
ulong BIOSPhysAddr,
void *mappedBIOS)
{
// TODO: This function is used to run the BIOS POST code on a secondary
// controller to initialise it for use. This is not necessary
// for multi-controller operation, but it will make it a lot
// more convenicent for end users (otherwise they have to boot
// the system once with the secondary controller as primary, and
// then boot with both controllers installed).
//
// Even if you don't support full BIOS access, it would be
// adviseable to be able to POST the secondary controllers in the
// system using this function as a minimum requirement. Some
// graphics hardware has registers that contain values that only
// the BIOS knows about, which makes bring up a card from cold
// reset difficult if the BIOS has not POST'ed it.
/* TODO: This function is used to run the BIOS POST code on a secondary */
/* controller to initialise it for use. This is not necessary */
/* for multi-controller operation, but it will make it a lot */
/* more convenicent for end users (otherwise they have to boot */
/* the system once with the secondary controller as primary, and */
/* then boot with both controllers installed). */
/* */
/* Even if you don't support full BIOS access, it would be */
/* adviseable to be able to POST the secondary controllers in the */
/* system using this function as a minimum requirement. Some */
/* graphics hardware has registers that contain values that only */
/* the BIOS knows about, which makes bring up a card from cold */
/* reset difficult if the BIOS has not POST'ed it. */
return false;
}
@ -817,8 +817,8 @@ shared libraries, simply return NULL.
PM_MODULE PMAPI PM_loadLibrary(
const char *szDLLName)
{
// TODO: This function should load a native shared library from disk
// given the path to the library.
/* TODO: This function should load a native shared library from disk */
/* given the path to the library. */
(void)szDLLName;
return NULL;
}
@ -831,8 +831,8 @@ void * PMAPI PM_getProcAddress(
PM_MODULE hModule,
const char *szProcName)
{
// TODO: This function should return the address of a named procedure
// from a native shared library.
/* TODO: This function should return the address of a named procedure */
/* from a native shared library. */
(void)hModule;
(void)szProcName;
return NULL;
@ -845,7 +845,7 @@ Unload a shared library.
void PMAPI PM_freeLibrary(
PM_MODULE hModule)
{
// TODO: This function free a previously loaded native shared library.
/* TODO: This function free a previously loaded native shared library. */
(void)hModule;
}
@ -860,8 +860,8 @@ the switch occurred so it can be properly restored.
int PMAPI PM_setIOPL(
int level)
{
// TODO: This function should enable IOPL for the task (if IOPL is
// not always enabled for the app through some other means).
/* TODO: This function should enable IOPL for the task (if IOPL is */
/* not always enabled for the app through some other means). */
return level;
}
@ -873,9 +873,9 @@ void *PMAPI PM_findFirstFile(
const char *filename,
PM_findData *findData)
{
// TODO: This function should start a directory enumeration search
// given the filename (with wildcards). The data should be
// converted and returned in the findData standard form.
/* TODO: This function should start a directory enumeration search */
/* given the filename (with wildcards). The data should be */
/* converted and returned in the findData standard form. */
(void)filename;
(void)findData;
return PM_FILE_INVALID;
@ -889,10 +889,10 @@ ibool PMAPI PM_findNextFile(
void *handle,
PM_findData *findData)
{
// TODO: This function should find the next file in directory enumeration
// search given the search criteria defined in the call to
// PM_findFirstFile. The data should be converted and returned
// in the findData standard form.
/* TODO: This function should find the next file in directory enumeration */
/* search given the search criteria defined in the call to */
/* PM_findFirstFile. The data should be converted and returned */
/* in the findData standard form. */
(void)handle;
(void)findData;
return false;
@ -905,8 +905,8 @@ Function to close the find process
void PMAPI PM_findClose(
void *handle)
{
// TODO: This function should close the find process. This may do
// nothing for some OS'es.
/* TODO: This function should close the find process. This may do */
/* nothing for some OS'es. */
(void)handle;
}
@ -954,7 +954,7 @@ void PMAPI PM_setFileAttr(
const char *filename,
uint attrib)
{
// TODO: Set the file attributes for a file
/* TODO: Set the file attributes for a file */
(void)filename;
(void)attrib;
}

View File

@ -36,7 +36,7 @@ Initialise the Zen Timer module internals.
****************************************************************************/
void __ZTimerInit(void)
{
// TODO: Do any specific internal initialisation in here
/* TODO: Do any specific internal initialisation in here */
}
/****************************************************************************
@ -46,8 +46,8 @@ Start the Zen Timer counting.
static void __LZTimerOn(
LZTimerObject *tm)
{
// TODO: Start the Zen Timer counting. This should be a macro if
// possible.
/* TODO: Start the Zen Timer counting. This should be a macro if */
/* possible. */
}
/****************************************************************************
@ -57,8 +57,8 @@ Compute the lap time since the timer was started.
static ulong __LZTimerLap(
LZTimerObject *tm)
{
// TODO: Compute the lap time between the current time and when the
// timer was started.
/* TODO: Compute the lap time between the current time and when the */
/* timer was started. */
return 0;
}
@ -69,7 +69,7 @@ Stop the Zen Timer counting.
static void __LZTimerOff(
LZTimerObject *tm)
{
// TODO: Stop the timer counting. Should be a macro if possible.
/* TODO: Stop the timer counting. Should be a macro if possible. */
}
/****************************************************************************
@ -79,7 +79,7 @@ Compute the elapsed time in microseconds between start and end timings.
static ulong __LZTimerCount(
LZTimerObject *tm)
{
// TODO: Compute the elapsed time and return it. Always microseconds.
/* TODO: Compute the elapsed time and return it. Always microseconds. */
return 0;
}
@ -95,9 +95,9 @@ Read the Long Period timer from the OS
****************************************************************************/
static ulong __ULZReadTime(void)
{
// TODO: Read the long period timer from the OS. The resolution of this
// timer should be around 1/20 of a second for timing long
// periods if possible.
/* TODO: Read the long period timer from the OS. The resolution of this */
/* timer should be around 1/20 of a second for timing long */
/* periods if possible. */
}
/****************************************************************************

Some files were not shown because too many files have changed in this diff Show More