diff --git a/src/sys/deviceman/bus_resources_portio.c b/src/sys/deviceman/bus_resources_portio.c index 73b7c9c..985e568 100755 --- a/src/sys/deviceman/bus_resources_portio.c +++ b/src/sys/deviceman/bus_resources_portio.c @@ -1,78 +1,78 @@ -/* - "bus_resources_portio.c" - - created by: grayspace aka J. Leveille - for: UbixOS Project - date: May 12, 2002 - - purpose: for port IO resource management - - $Id$ -*/ - -#include "../../grayspace-misc/gsdefines.h" -#include "../../sys/include/misc/misc_bit_array.h" -#include "../../sys/include/deviceman/bus_resources.h" - -/* checks a range of port addresses - returns: - - 1 if the range is comptetely empty - - 0 otherwise */ -int BUS_PORTIO_CheckRange( BUS_PORTIO_POOL * p_bpp, - DWORDg baseaddr, - DWORDg overaddr ) -{ - BIT_ARRAY_RANGE_PARAMS rp; - BIT_ARRAY_MAKERANGEPARAMS( rp, p_bpp->a_addrs, baseaddr, overaddr ); - return BIT_ARRAY_IsRangeEmpty( &rp ); -} - -/* allocates a range of port addresses - returns: - - 1 on success - - 0 on failure */ -int BUS_PORTIO_AllocateRange( BUS_PORTIO_POOL * p_bpp, - DWORDg baseaddr, - DWORDg overaddr ) -{ - BIT_ARRAY_RANGE_PARAMS rp; - BIT_ARRAY_MAKERANGEPARAMS( rp, p_bpp->a_addrs, baseaddr, overaddr ); - - /* check if this port range is free */ - if( BIT_ARRAY_IsRangeEmpty( &rp ) ) - { - /* allocate it */ - BIT_ARRAY_SetRange( &rp ); - - /* success */ - return 1; - } - - /* fail */ - return 0; -} - -/* frees a range of port addresses - returns: - - 1 if any port addresses in the range were allocated - - 0 otherwise */ -int BUS_PORTIO_FreeRange( BUS_PORTIO_POOL * p_bpp, - DWORDg baseaddr, - DWORDg overaddr ) -{ - BIT_ARRAY_RANGE_PARAMS rp; - BIT_ARRAY_MAKERANGEPARAMS( rp, p_bpp->a_addrs, baseaddr, overaddr ); - - /* check if this port range is free */ - if( !BIT_ARRAY_IsRangeEmpty( &rp ) ) - { - /* free it */ - BIT_ARRAY_ResetRange( &rp ); - - /* success */ - return 1; - } - - /* fail */ - return 0; +/* + "bus_resources_portio.c" + + created by: grayspace aka J. Leveille + for: UbixOS Project + date: May 12, 2002 + + purpose: for port IO resource management + + $Id$ +*/ + +#include "../../grayspace-misc/gsdefines.h" +#include "../../sys/include/misc/misc_bit_array.h" +#include "../../sys/include/deviceman/bus_resources.h" + +/* checks a range of port addresses + returns: + - 1 if the range is comptetely empty + - 0 otherwise */ +int BUS_PORTIO_CheckRange( BUS_PORTIO_POOL * p_bpp, + DWORDg baseaddr, + DWORDg overaddr ) +{ + BIT_ARRAY_RANGE_PARAMS rp; + BIT_ARRAY_MAKERANGEPARAMS( rp, p_bpp->a_addrs, baseaddr, overaddr ); + return BIT_ARRAY_IsRangeEmpty( &rp ); +} + +/* allocates a range of port addresses + returns: + - 1 on success + - 0 on failure */ +int BUS_PORTIO_AllocateRange( BUS_PORTIO_POOL * p_bpp, + DWORDg baseaddr, + DWORDg overaddr ) +{ + BIT_ARRAY_RANGE_PARAMS rp; + BIT_ARRAY_MAKERANGEPARAMS( rp, p_bpp->a_addrs, baseaddr, overaddr ); + + /* check if this port range is free */ + if( BIT_ARRAY_IsRangeEmpty( &rp ) ) + { + /* allocate it */ + BIT_ARRAY_SetRange( &rp ); + + /* success */ + return 1; + } + + /* fail */ + return 0; +} + +/* frees a range of port addresses + returns: + - 1 if any port addresses in the range were allocated + - 0 otherwise */ +int BUS_PORTIO_FreeRange( BUS_PORTIO_POOL * p_bpp, + DWORDg baseaddr, + DWORDg overaddr ) +{ + BIT_ARRAY_RANGE_PARAMS rp; + BIT_ARRAY_MAKERANGEPARAMS( rp, p_bpp->a_addrs, baseaddr, overaddr ); + + /* check if this port range is free */ + if( !BIT_ARRAY_IsRangeEmpty( &rp ) ) + { + /* free it */ + BIT_ARRAY_ResetRange( &rp ); + + /* success */ + return 1; + } + + /* fail */ + return 0; } \ No newline at end of file diff --git a/src/sys/include/deviceman/bus_resources.h b/src/sys/include/deviceman/bus_resources.h index 45978e4..c00f4b0 100755 --- a/src/sys/include/deviceman/bus_resources.h +++ b/src/sys/include/deviceman/bus_resources.h @@ -31,6 +31,11 @@ #define MAX_PORTIO_ADDR (1023) #define MAXBITS_PORTIO_ADDR (10) +/* Memory Range */ +#define MIN_MEMIO_ADDR (0) +#define MAX_MEMIO_ADDR (0xFFFFFFFF) +#define MAXBITS_MEMIO_ADDR (32) + /* NOTE: 'BI_' denotes roughly something related to BUS info */ /* for building/use-with device-info/bus-resource-info structures */ @@ -63,6 +68,9 @@ /* maximum number of Port IO ranges a device can use */ #define BI_MAX_PORTIO_RANGES (4) +/* maximum number of Memory IO ranges a device can use */ +#define BI_MAX_MEMIO_RANGES (4) + /* structure for storing a device's bus resources */ typedef struct tagBUS_RESOURCES { @@ -74,10 +82,20 @@ bits [2,3] number of DMA channels used bits [4,7] number of port IO ranges used */ - BYTEg resource_counts; + BYTEg resource_counts1; + + /* + bits [0,3] number of memory ranges used + bits [4,7] ??? + */ + BYTEg resource_counts2; /* Port IO Ranges */ DWORDg a_portiorange[BI_MAX_PORTIO_RANGES]; + + /* Memory IO Ranges */ + DWORDg a_memiorange_base[BI_MAX_MEMIO_RANGES]; + DWORDg a_memiorange_last[BI_MAX_MEMIO_RANGES]; } BUS_RESOURCES; @@ -181,32 +199,61 @@ && ( BI_PORTIO_OVERADDR_BIT == BI_NUMBITS_PORTIO_BASEADDR ) */ +/* get mem IO base address 'idx' from resource description 'br' */ +#define BUS_RES_GETMIOBASE( br, idx )\ + ((br).a_memiorange_base[(idx)]) + +/* get mem IO 'last' address 'idx' from resource description 'br' */ +#define BUS_RES_GETMEMIOLAST( br, idx )\ + ((br).a_memiorange_last[(idx)]) + +/* get mem IO range 'idx' from resource description 'br' + into 'baseaddr_o' and 'lastaddr_o' */ +#define BUS_RES_GETMEMIORANGE( br, idx, baseaddr_o, lastaddr_o )\ + (baseaddr_o)\ + = (br).a_memiorange_base[(idx)];\ + (lastaddr_o)\ + = (br).a_memiorange_last[(idx)] + +/* set port IO range 'idx' in resource description 'br' + to 'baseaddr' and 'lastaddr' */ +#define BUS_RES_SETMEMIORANGE( br, idx, baseaddr, lastaddr )\ + (br).a_memiorange_base[(idx)] = baseaddr;\ + (br).a_memiorange_last[(idx)] = lastaddr /* HACK: because no defines used for bit numbers */ -/* get number of IRQs used/assign-to device */ +/* get number of IRQs used/assigned-to device */ #define BUS_RES_GETIRQSUSED( br )\ - (((br).resource_counts & 0x0C)>>2) -/* set number of IRQs used/assign-to device */ + (((br).resource_counts1 & 0x0C)>>2) +/* set number of IRQs used/assigned-to device */ #define BUS_RES_SETIRQSUSED( br, irqsused )\ - (br).resource_counts &= ~0x0C;\ - (br).resource_counts |= ((irqsused)<<2) + (br).resource_counts1 &= ~0x0C;\ + (br).resource_counts1 |= ((irqsused)<<2) -/* get number of DMAs used/assign-to device */ +/* get number of DMAs used/assigned-to device */ #define BUS_RES_GETDMASUSED( br )\ - ((br).resource_counts & 3) -/* set number of DMAs used/assign-to device */ + ((br).resource_counts1 & 3) +/* set number of DMAs used/assigned-to device */ #define BUS_RES_SETDMASUSED( br, dmasused )\ - (br).resource_counts &= ~3;\ - (br).resource_counts |= (dmasused) + (br).resource_counts1 &= ~3;\ + (br).resource_counts1 |= (dmasused) -/* get number of port IO ranges used/assign-to device */ +/* get number of port IO ranges used/assigned-to device */ #define BUS_RES_GETPORTIORANGESUSED( br )\ - (((br).resource_counts)>>4) -/* get number of port IO ranges used/assign-to device */ + (((br).resource_counts1)>>4) +/* get number of port IO ranges used/assigned-to device */ #define BUS_RES_SETPORTIORANGESUSED( br, rangesused )\ - (br).resource_counts &= 0x0F;\ - (br).resource_counts |= ((rangesused)<<4) + (br).resource_counts1 &= 0x0F;\ + (br).resource_counts1 |= ((rangesused)<<4) + +/* get number of port IO ranges used/assigned-to device */ +#define BUS_RES_GETMEMIORANGESUSED( br )\ + (((br).resource_counts2) & 0x0F) +/* get number of port IO ranges used/assigned-to device */ +#define BUS_RES_SETMEMIORANGESUSED( br, rangesused )\ + (br).resource_counts2 &= 0xF0;\ + (br).resource_counts2 |= (rangesused) #else /* #if TCPU_IA32 */ diff --git a/src/sys/include/deviceman/device.h b/src/sys/include/deviceman/device.h index 3097f7d..b4b1e31 100755 --- a/src/sys/include/deviceman/device.h +++ b/src/sys/include/deviceman/device.h @@ -24,6 +24,32 @@ #define DEVICE_TYPE_BUS_ISA (1) #define DEVICE_TYPE_BUS_PCI (2) +/* device classes */ +#define DEVICE_CLASS_GENERIC (0) +#define DEVICE_CLASS_SOUND_DAC (1) +#define DEVICE_CLASS_VIDEO (2) +#define DEVICE_CLASS_NIC (3) +#define DEVICE_CLASS_DISK_CTLR (4) +#define DEVICE_CLASS_DISK (5) + +/* string names for devices classes + (for use in device list configuration files) */ +#define DEVICE_CLASS_GENERIC_IDSTR "GENERIC" +#define DEVICE_CLASS_SOUND_DAC_IDSTR "SOUND_DAC" +#define DEVICE_CLASS_VIDEO_IDSTR "VIDEO" +#define DEVICE_CLASS_NIC_IDSTR "NIC" +#define DEVICE_CLASS_DISK_CTLR_IDSTR "DISK_CTLR" +#define DEVICE_CLASS_DISK_IDSTR "DISK" + +/* string names for devices classes + (for display to the user) */ +#define DEVICE_CLASS_GENERIC_NAME "Generic Device" +#define DEVICE_CLASS_SOUND_DAC_NAME "Sound (Digital-Ananlog Output)" +#define DEVICE_CLASS_VIDEO_NAME "Video Card" +#define DEVICE_CLASS_NIC_NAME "Network Card" +#define DEVICE_CLASS_DISK_CTLR_NAME "Disk Controller" +#define DEVICE_CLASS_DISK_NAME "Disk Device" + /* device ISR or pseudo ISR */ typedef int (* DEVICE_ISR)( void * p ); @@ -56,7 +82,7 @@ { int dummy; } -DEVICE_PCI; +DEVICE_BUS_PCI; /* bus device structure */ typedef union tagDEVICE_BUS diff --git a/src/sys/include/deviceman/isapnp.h b/src/sys/include/deviceman/isapnp.h index f2f130c..08e8bba 100755 --- a/src/sys/include/deviceman/isapnp.h +++ b/src/sys/include/deviceman/isapnp.h @@ -13,6 +13,63 @@ #ifndef _ISAPNP_H #define _ISAPNP_H +#include "misc_string_conv.h" + +/* structure for holding an ISA-PNP device ID */ +typedef struct tagISAPNP_ID +{ + WORDg text; + BYTEg a_hex[2]; +} +ISAPNP_ID; + +/* structure for holding configuration file info about a + particular ISA-PNP device */ +typedef struct tagISAPNP_DEV_INFO +{ + /* 'class' of device */ + BYTEg devclass; + + /* device ID */ + ISAPNP_ID id; + + /* kernal string ID of description */ + DWORDg descID; +} +ISAPNP_DEV_INFO; + +/* structure for holding device info database + NOTE: should be sorted by 'id' */ +typedef struct tagISAPNP_DEV_INFO_DB +{ + // pointer to infos + ISAPNP_DEV_INFO * p_infos; + + // number of infos + int numinfos; +} +ISAPNP_DEV_INFO_DB; + +/* fill a 'ISAPNP_ID' struct from four bytes assumed to be in little endian + format */ +#define ISAPNP_ID_FROMBYTES( dst_id, p_bytes )\ + (dst_id).text = (WORDg) (((DWORDg) (p_bytes)[1])<<8);\ + (dst_id).text |= (WORDg) (p_bytes)[1] + +/* + NOTE: + - in 'id.text' + - bits [10,14] are first character - 64 + - bits [5,9] are second character - 64 + - bits [0,4] are third character - 64 +*/ +#define ISAPNP_ID_GETSTRING( p_dststr, id )\ + (p_dststr)[0] = (((id).text >> 10)&0x1F) + 64;\ + (p_dststr)[1] = (((id).text >> 5)&0x1F) + 64;\ + (p_dststr)[2] = ((id).text&0x1F) + 64;\ + HEX_GETSTRING_BYTE_NONULL( p_dst_str + 3, (id).a_hex[1] );\ + HEX_GETSTRING_BYTE( p_dst_str + 5, (id).a_hex[0] ) + #define ACCESS_FUNC_PORT "movl %edx, $0x279\n\t" #define ACCESS_DATA_PORT "movl %edx, $0x2A9\n\t" #define FUNC_SETREADPORT "movb $0x00, %al\n\toutb %dx, %al\n\t" diff --git a/src/tools/build_isa_pnp_files.c b/src/tools/build_isa_pnp_files.c new file mode 100755 index 0000000..885437c --- /dev/null +++ b/src/tools/build_isa_pnp_files.c @@ -0,0 +1,387 @@ +/* + "build_isa_pnp_files.c" + + created by: grayspace aka J. Leveille + for: UbixOS Project + date: July 7, 2002 + + purpose: - tool to create the necessary source files + for ISAPNP devices based on certain configuration files + - built and run by the makefile for the kernel (eventually) + + NOTES: kinda hacky for now, but hey! it's only an intermediary tool! + + $Id$ +*/ + +// dependancy +#include "..\grayspace-misc\gsdefines.h" +#include "..\sys\include\deviceman\bus_resources.h" +#include "..\sys\include\deviceman\device.h" +#include "build_isa_pnp_files.h" +#include +#include +#include + +#define CLASS_NAME_CHARS (31) +#define DEVDESC_MAX_CHARS (255) +#define DEVID_CHARS (7) + +typedef struct tagISAPNP_TEMP_INFO +{ + // device ID in string form + char a_IDstr[DEVID_CHARS + 1]; + + // device description in string form + char a_desc[DEVDESC_MAX_CHARS + 1]; + + // device class in string form + char a_class[CLASS_NAME_CHARS + 1]; +} +ISAPNP_TEMP_INFO; + +// current temporary info +ISAPNP_TEMP_INFO * g_p_infos = NULL; +int g_numinfos = 0; + +static void FreeInfos() +{ + if( g_p_infos ) + { + free( g_p_infos ); + g_p_infos = NULL; + } + g_numinfos = 0; +} + +static void FreeAll() +{ + FreeInfos(); +} + +static void AllocateInfos( int numinfos ) +{ + FreeInfos(); + g_p_infos = malloc( sizeof(ISAPNP_TEMP_INFO) * numinfos ); +} + +#define LINEBUFFCHARS ( ( CLASS_NAME_CHARS\ + + DEVDESC_MAX_CHARS\ + + CLASS_NAME_CHARS\ + + 3 ) * 2 ) + +/* HACK */ +const static char * g_ap_validclassnames[] = +{ + DEVICE_CLASS_GENERIC_IDSTR, + DEVICE_CLASS_SOUND_DAC_IDSTR, + DEVICE_CLASS_VIDEO_IDSTR, + DEVICE_CLASS_NIC_IDSTR, + DEVICE_CLASS_DISK_CTLR_IDSTR, + DEVICE_CLASS_DISK_IDSTR +}; + +#define NUMCLASSNAMES (sizeof(g_ap_validclassnames)/sizeof(char *)) + +static int ClassNameValid( const char * p_name ) +{ + int i; + for( i = 0; i < NUMCLASSNAMES; i++ ) + { + if( strcmp( p_name, g_ap_validclassnames[i] ) ) + { + return 1; + } + } + + return 0; +} + +const static char g_whitespace[] = " \t\n"; +const static char g_classdelimit[] = ";"; + +// returns number of non-white space chars remaining +static int RemoveWhiteSpace( char * p_str ) +{ + char buff[LINEBUFFCHARS + 1]; + char * p_curchar; + int numnonwhitechars; + + p_curchar = p_str; + numnonwhitechars = 0; + + // skip past leading white space + while( *p_curchar != 0 + && ( *p_curchar == '\t' + || *p_curchar == ' ' ) ) + { + p_curchar++; + } + + // copy string with no white space to 'buff' + strcpy( buff, p_curchar ); + + // go to last char + p_curchar = buff + (strlen(buff) - 1); + + // if string non empty, NULL terminate buff after last non-whitespace char + if( p_curchar >= buff ) + { + // non empty + while( *p_curchar == '\t' + || *p_curchar == ' ' ) + { + p_curchar--; + } + p_curchar++; + + if( p_curchar > buff ) + { + // non empty will remain + *p_curchar = 0; + + // copy back to original string + strcpy( p_str, buff ); + + // return characters remaining + return strlen( p_str ); + } + } + + // empty string remains + return 0; +} + +static int FillInfo( ISAPNP_TEMP_INFO * p_infos, + int idx, + char * p_line, + int linenum ) +{ + char * p_curbuff; + ISAPNP_TEMP_INFO * p_i; + + // get current info + p_i = p_infos + idx; + + // extract pnp ID + p_curbuff = p_line; + p_curbuff = strtok( p_curbuff, g_whitespace ); + if( !p_curbuff ) + { + // empty line + return 0; + } + + if( *p_curbuff == ';' || *p_curbuff == '#' ) + { + // comment + return 0; + } + + if( strlen( p_curbuff ) == DEVID_CHARS ) + { + // device ID string ok + // TODO: parse more thoroughly + strcpy( p_i->a_IDstr, p_curbuff ); + + // fetch everything up until the class name delimiter + p_curbuff = strtok( NULL, g_classdelimit ); + + if( !p_curbuff ) + { + // no class id, assume generic + + // fetch description + p_curbuff = strtok( NULL, g_whitespace ); + + // copy + if( p_curbuff ) + { + if( strlen( p_curbuff ) <= DEVDESC_MAX_CHARS ) + { + strcpy( p_i->a_desc, p_curbuff ); + } + else + { + printf( "[FillInfo], Warning, device description too long in line: %d, Ignoring\n.", linenum ); + return 0; + } + } + else + { + printf( "[FillInfo], Warning, device description missing in line: %d, Ignoring\n.", linenum ); + return 0; + } + + // fill class as generic + strcpy( p_i->a_class, DEVICE_CLASS_GENERIC_NAME ); + } + else + { + // copy description + if( strlen( p_curbuff ) <= DEVDESC_MAX_CHARS ) + { + strcpy( p_i->a_desc, p_curbuff ); + } + else + { + printf( "[FillInfo], Warning, device description too long in line: %d, Ignoring\n.", linenum ); + return 0; + } + + // trim it's whitespace + RemoveWhiteSpace( p_i->a_desc ); + + // fetch the class id: + p_curbuff = strtok( NULL, g_whitespace ); + + if( p_curbuff ) + { + if( ClassNameValid( p_curbuff ) ) + { + // copy it + strcpy( p_i->a_class, p_curbuff ); + } + else + { + printf( "[FillInfo], Warning, invalid device class in line: %d, Ignoring\n.", linenum ); + return 0; + } + } + else + { + printf( "[FillInfo], Warning, missing device class in line: %d, but delimiter is there, Ignoring\n.", linenum ); + return 0; + } + } + + // success + return 1; + } + + printf( "[FillInfo], Warning, invalid PNP-ID in line: %d, Ignoring\n.", linenum ); + return 0; +} + +static int ReadInConfigFile( const char * p_path ) +{ + FILE * p_file; + int numlines; + int linenum; + char buff[LINEBUFFCHARS + 1]; + + // open the file + if( !(p_file = fopen( p_path, "rt" )) ) + { + printf( "[ReadInConfigFile] Error, cannot open file: %s.\n", p_path ); + return 0; + } + + // count our maximum number of descriptions + + // go to beginning of file + if( fseek( p_file, 0L, SEEK_SET ) ) + { + goto failbail; + } + + // count our lines: + numlines = 0; + while( fgets( buff, LINEBUFFCHARS, p_file ) != NULL ) + { + numlines++; + } + + // (re)allocate our infos + AllocateInfos( numlines ); + + // fill our infos + + // go to beginning of file + if( fseek( p_file, 0L, SEEK_SET ) ) + { + goto failbail; + } + + // read each line as info if possible + g_numinfos = 0; + linenum = 0; + while( fgets( buff, LINEBUFFCHARS, p_file ) != NULL ) + { + if( FillInfo( g_p_infos, g_numinfos, buff, linenum ) ) + { + g_numinfos++; + } + linenum++; + } + + // close file + fclose( p_file ); + + if( g_numinfos ) + { + // success + return 1; + } + +failbail: + // close file + fclose( p_file ); + // free infos + FreeInfos(); + printf( "[ReadInConfigFile] Error parsing file: %s.\n", p_path ); + return 0; +} + +static int WriteDescriptionStringsFile( const char * p_path ) +{ + FILE * p_file; + int i; + + // open the file + if( !(p_file = fopen( p_path, "rt" )) ) + { + printf( "[ReadInConfigFile] Error, cannot open file: %s.\n", p_path ); + return 0; + } + + // write out every description line + for( i = 0; i < g_numinfos; i++ ) + { + if( fputs( g_p_infos[i].a_desc, p_file ) != EOF ) + { + if( fputs( "\n", p_file ) != EOF ) + { + continue; + } + } + + goto failbail; + } + + // success: + return 1; + +failbail: + // close file + fclose( p_file ); + printf( "[WriteDescriptionStringsFile] Error, cannot write to file\n" ); + return 0; +} + +void main( void ) +{ + // first, read in and extract all ISA-PNP devices from configuration file + if( !ReadInConfigFile( DEVLIST_FILEPATH_IN ) ) + { + FreeAll(); + return; + } + + // now, generate text file of strings used for device descriptions + if( !WriteDescriptionStringsFile( DEVSTRINGS_FILEPATH_TMP ) ) + { + FreeAll(); + return; + } +} \ No newline at end of file diff --git a/src/tools/build_isa_pnp_files.h b/src/tools/build_isa_pnp_files.h new file mode 100755 index 0000000..4f0794f --- /dev/null +++ b/src/tools/build_isa_pnp_files.h @@ -0,0 +1,40 @@ +/* + "build_isa_pnp_files.h" + + created by: grayspace aka J. Leveille + for: UbixOS Project + date: July 7, 2002 + + purpose: - tool to create the necessary source files + for ISAPNP devices based on certain configuration files + - built and run by the makefile for the kernel (eventually) + + $Id$ +*/ + +#ifndef _BUILD_ISA_PNP_FILES_H +#define _BUILD_ISA_PNP_FILES_H + +// input configuration file for ISAPNP stuff +#define DEVLIST_FILEPATH_IN "pnpisadevs.txt" + +// temporary file to hold strings needed to be output to user +#define DEVSTRINGS_FILEPATH_TMP "pnpisadevs_strings.txt" + +// header file for string pool to be generated +#define DEVLIST_KSTR_POOL_HDR_OUT "isa_pnp_stringpool.h" + +// source file for string pool to be generated +#define DEVLIST_KSTR_POOL_SRC_OUT "isa_pnp_stringpool.c" + +// major header file for ISAPNP device data-base +// (to contain devices sorted by ID etc.) +#define DEVLIST_HDR_OUT "isa_pnp_devicelist.h" + +// major source file for ISAPNP device data-base +// (to contain devices sorted by ID etc.) +#define DEVLIST_SRC_OUT "isa_pnp_devicelist.c" + + + +#endif // _BUILD_ISA_PNP_FILES_H \ No newline at end of file diff --git a/src/tools/make_kernel_string_pool.c b/src/tools/make_kernel_string_pool.c new file mode 100755 index 0000000..5e10f3e --- /dev/null +++ b/src/tools/make_kernel_string_pool.c @@ -0,0 +1,655 @@ +/* + "make_kernel_string_pool.c" + + created by: grayspace aka J. Leveille + for: UbixOS Project + date: July 3, 2002 + + purpose: - tool to create string pools for in kernel use + - will generate the source for including a global + set of ASCII (for now) strings into the kernel + to avoid memory wastage for kernel output strings + for long lists of things such as device descriptions + + NOTEs: + - for now only ASCII is supported + + TODO: + - expand to support unicode + - use huffman encoding instead + + $Id$ +*/ + +/* + SubStringfile format: + - each on it's own line, each unique substring +*/ + +#include +#include +#include + +typedef struct tagSUBSTRLIST +{ + char ** pp_substrs; + int numsubstrs; +} +SUBSTRLIST; + +// current open sub string file +FILE * g_p_file_substrs = NULL; + +// main/current list of sub strings +SUBSTRLIST g_mainsubstrs = { NULL, 0 }; + +// temporary lists of substrings +SUBSTRLIST g_tempsubstrs1 = { NULL, 0 }; +SUBSTRLIST g_tempsubstrs2 = { NULL, 0 }; + +// free all memory associated with the sub string list +static void Free_SubStringList( SUBSTRLIST * p_ssl ) +{ + int i; + if( p_ssl->pp_substrs != NULL ) + { + for( i = 0; i < p_ssl->numsubstrs; i++ ) + { + if( p_ssl->pp_substrs[i] != NULL ) + { + free( p_ssl->pp_substrs[i] ); + p_ssl->pp_substrs[i] = NULL; + } + } + + free( p_ssl->pp_substrs ); + p_ssl->pp_substrs = NULL; + p_ssl->numsubstrs = 0; + } +} + +// compare two pointers to strings +static int CompareStringPtr( const void * p1, const void * p2 ) +{ + return strcmp( *((const char **) p1), *((const char **) p2) ); +} + +// sorts a sub string list into alphabetical order +// list cannot be empty for success +// returns 1 on success, 0 on failure +static int Sort_SubStringList( SUBSTRLIST * p_ssl ) +{ + if( p_ssl->numsubstrs && p_ssl->pp_substrs ) + { + // sort by pointer + qsort( p_ssl->pp_substrs, + p_ssl->numsubstrs, + sizeof(char *), + CompareStringPtr ); + + return 1; + } + + return 0; +} + +// given an open sub string file, creates a 'SUBSTRLIST' with its +// contents (the file should contain a list of unique substrings +// in alphabetical order) +// +// on failure: +// - frees/empties the given list +// - returns 0 +// on success: +// - returns 1 +static int Create_SubStringList( SUBSTRLIST * p_ssl, FILE * p_file ) +{ + int i; + int numlines; + char buff[1025]; + + // go to beginning of file + if( fseek( p_file, 0L, SEEK_SET ) ) + { + goto failbail; + } + + // count our lines: + numlines = 0; + while( fgets( buff, 1024, p_file ) != NULL ) + { + numlines++; + } + + // go to beginning of file + if( fseek( p_file, 0L, SEEK_SET ) ) + { + goto failbail; + } + + // re-allocate our substring list: + Free_SubStringList( p_ssl ); + p_ssl->numsubstrs = numlines; + p_ssl->pp_substrs = (char **) malloc( sizeof(char *) * p_ssl->numsubstrs ); + + // read each substring + for( i = 0; i < p_ssl->numsubstrs; i++ ) + { + if( fgets( buff, 1024, p_file ) != NULL ) + { + p_ssl->pp_substrs[i] + = (char *) malloc( sizeof(char) * (strlen( buff ) + 1) ); + strcpy( p_ssl->pp_substrs[i], buff ); + continue; + } + + goto failbail; + } + + // sort the substrings into alphabetical order + if( Sort_SubStringList( p_ssl ) ) + { + // success: + return 1; + } + +failbail: + Free_SubStringList( p_ssl ); + printf( "[Create_SubStringList] Error" ); + return 0; +} + +// Given an open file which contains plain text, builds a sub string list +// of unique sub strings into the list given as 'p_ssl' +// NOTE: destroys/frees the contents of 'p_ssl' +// regardless of success or failure +const static char g_whitespace[] = " \t\n"; +static int BuildFromFile_SubStrings( SUBSTRLIST * p_ssl, FILE * p_file ) +{ + int i; + int numwords; + char buff[1025]; + char * p_curbuff; + + // destroy the current list + Free_SubStringList( p_ssl ); + + // go to beginning of file + if( fseek( p_file, 0L, SEEK_SET ) ) + { + goto failbail; + } + + // count our words: + numwords = 0; + while( (p_curbuff = fgets( buff, 1024, p_file )) != NULL ) + { + p_curbuff = strtok( p_curbuff, g_whitespace ); + while( p_curbuff ) + { + numwords++; + p_curbuff = strtok( NULL, g_whitespace ); + } + } + + // go to beginning of file + if( fseek( p_file, 0L, SEEK_SET ) ) + { + goto failbail; + } + + // read each substring from words in file + p_ssl->numsubstrs = numwords; + p_ssl->pp_substrs = (char **) malloc( sizeof(char *) * p_ssl->numsubstrs ); + for( i = 0; i < p_ssl->numsubstrs; ) + { + if( (p_curbuff = fgets( buff, 1024, p_file )) != NULL ) + { + p_curbuff = strtok( p_curbuff, g_whitespace ); + while( p_curbuff ) + { + p_ssl->pp_substrs[i] + = (char *) malloc( sizeof(char) * (strlen( p_curbuff ) + 1) ); + strcpy( p_ssl->pp_substrs[i], p_curbuff ); + i++; + p_curbuff = strtok( NULL, g_whitespace ); + } + continue; + } + + goto failbail; + } + + // sort the substrings into alphabetical order + if( Sort_SubStringList( p_ssl ) ) + { + // success: + return 1; + } + +failbail: + Free_SubStringList( p_ssl ); + printf( "[Create_SubStringList] Error" ); + return 0; +} + +// creates a new 'SUBSTRLIST' into 'p_ssl_dst' by +// combining the sub-strings in 'p_ssl_src1' and 'p_ssl_src2' +// then it clears/frees both 'p_ssl_src1' and 'p_ssl_src2' +// so that they are empty +// NOTE: will destroy any contents in 'p_ssl_dst' safely +static void Combine_SubStringLists( SUBSTRLIST * p_ssl_dst, + SUBSTRLIST * p_ssl_src1, + SUBSTRLIST * p_ssl_src2 ) +{ + int src_idx_1; + int src_idx_2; + int src_idx; + int dst_idx; + SUBSTRLIST * p_ssl_src; + + // free the destination list + Free_SubStringList( p_ssl_dst ); + + // set number of strings in dest list + p_ssl_dst->numsubstrs = p_ssl_src1->numsubstrs + p_ssl_src2->numsubstrs; + + // allocate strings pointers + p_ssl_dst->pp_substrs + = (char **) malloc( sizeof(char *) * p_ssl_dst->numsubstrs ); + + // combine lists, preserving alphabetical order + src_idx_1 = 0; + src_idx_2 = 0; + dst_idx = 0; + while( src_idx_1 < p_ssl_src1->numsubstrs + && src_idx_2 < p_ssl_src2->numsubstrs ) + { + if( strcmp( p_ssl_src1->pp_substrs[src_idx_1], + p_ssl_src2->pp_substrs[src_idx_2] ) <= 0 ) + { + // move string from source 1 + p_ssl_dst->pp_substrs[dst_idx] + = p_ssl_src1->pp_substrs[src_idx_1]; + p_ssl_src1->pp_substrs[src_idx_1] = NULL; + dst_idx++; + src_idx_1++; + continue; + } + + // move strings from source 2 + p_ssl_dst->pp_substrs[dst_idx] + = p_ssl_src2->pp_substrs[src_idx_2]; + p_ssl_src2->pp_substrs[src_idx_2] = NULL; + dst_idx++; + src_idx_2++; + } + + // find which source still has strings + p_ssl_src = p_ssl_src1; + src_idx = src_idx_1; + if( src_idx_2 < p_ssl_src2->numsubstrs ) + { + p_ssl_src = p_ssl_src2; + src_idx = src_idx_2; + } + + // add remaining strings + while( src_idx < p_ssl_src->numsubstrs ) + { + // move strings from source + p_ssl_dst->pp_substrs[dst_idx] + = p_ssl_src->pp_substrs[src_idx]; + p_ssl_src->pp_substrs[src_idx] = NULL; + dst_idx++; + src_idx++; + } + + // empty source strings + p_ssl_src1->numsubstrs = 0; + p_ssl_src2->numsubstrs = 0; + Free_SubStringList( p_ssl_src1 ); + Free_SubStringList( p_ssl_src2 ); +} + +// removes duplicate sub strings in sub string list +static void RemoveDuplicates_SubStrings( SUBSTRLIST * p_ssl ) +{ + char * p_checkstr; + int strsremoved; + int idx; + int dst_idx; + int src_idx; + + // first pass, remove and free all duplicate strings + // in their current position + strsremoved = 0; + idx = 0; + while( idx < p_ssl->numsubstrs ) + { + // get new check string + p_checkstr = p_ssl->pp_substrs[idx]; + idx++; + + // remove all duplicates of check string + while( idx < p_ssl->numsubstrs ) + { + if( strcmp( p_checkstr, p_ssl->pp_substrs[idx] ) == 0 ) + { + // remove duplicate + free( p_ssl->pp_substrs[idx] ); + p_ssl->pp_substrs[idx] = NULL; + strsremoved++; + idx++; + + // process next string + continue; + } + + // get new check string + break; + } + } + + // second pass, re-order + dst_idx = 0; + src_idx = 0; + while( src_idx < p_ssl->numsubstrs ) + { + // find next empty string section + while( dst_idx < p_ssl->numsubstrs ) + { + if( p_ssl->pp_substrs[dst_idx] ) + { + dst_idx++; + continue; + } + break; + } + + // find next non-empty string section + src_idx = dst_idx + 1; + while( src_idx < p_ssl->numsubstrs ) + { + if( !p_ssl->pp_substrs[src_idx] ) + { + src_idx++; + continue; + } + break; + } + + // move all non-empty strings into empty space + idx = src_idx; + while( dst_idx < src_idx + && idx < p_ssl->numsubstrs ) + { + if( p_ssl->pp_substrs[idx] ) + { + // move string + p_ssl->pp_substrs[dst_idx] = p_ssl->pp_substrs[idx]; + p_ssl->pp_substrs[idx] = NULL; + dst_idx++; + idx++; + + // process next string + continue; + } + + // start over + break; + } + } + + // adjust number of strings in list + p_ssl->numsubstrs -= strsremoved; +} + +// moves one string list to another +// (also cleans memory a little) +// NOTES: +// - this operation empties/frees 'p_ssl_src' +// - this operation overwrites the contents of 'p_ssl_dst' +static void Move_SubStrings( SUBSTRLIST * p_ssl_dst, + SUBSTRLIST * p_ssl_src ) +{ + int i; + + // free/clear the dest substrings + Free_SubStringList( p_ssl_dst ); + + // allocate new dest sub-strings + p_ssl_dst->numsubstrs = p_ssl_src->numsubstrs; + p_ssl_dst->pp_substrs + = (char **) malloc( sizeof(char *) * p_ssl_dst->numsubstrs ); + + // move the strings over + for( i = 0; i < p_ssl_dst->numsubstrs; i++ ) + { + p_ssl_dst->pp_substrs[i] = p_ssl_src->pp_substrs[i]; + p_ssl_src->pp_substrs[i] = NULL; + } + + // clear/free the source string + p_ssl_src->numsubstrs = 0; + Free_SubStringList( p_ssl_src ); +} + + +// writes given sub string list into given file +// on success: +// - old file contents are destroyed +// - returns 1 +// on failure: +// - old file contents are destroyed or mangled +// - returns 0 +static int Write_SubStrings( SUBSTRLIST * p_ssl, + FILE * p_file ) +{ + int i; + + // go to beginning of file + if( fseek( p_file, 0L, SEEK_SET ) ) + { + goto failbail; + } + + // write out all strings + for( i = 0; i < p_ssl->numsubstrs; i++ ) + { + if( fputs( p_ssl->pp_substrs[i], p_file ) != EOF ) + { + if( fputs( "\n", p_file ) != EOF ) + { + continue; + } + } + + goto failbail; + } + + // success: + return 1; + +failbail: + printf( "[Write_SubStrings] Error, cannot write to file\n" ); + return 0; +} + +// writes out and closes the current sub string file if possible +// and frees the current sub string list +// returns 1 on success, 0 on failure +int WriteAndClose_SubStringFile() +{ + if( g_p_file_substrs ) + { + if( Write_SubStrings( &g_mainsubstrs, g_p_file_substrs ) ) + { + // close the file + if( fclose( g_p_file_substrs ) == 0 ) + { + // success + g_p_file_substrs = NULL; + return 1; + } + + printf( "[WriteAndClose_SubStringFile] Error closing file\n" ); + goto failbail; + } + + printf( "[WriteAndClose_SubStringFile] Error, cannot write to file\n" ); + goto failbail; + } + + printf( "[WriteAndClose_SubStringFile] Error, never opened \n" ); + +failbail: + if( fclose( g_p_file_substrs ) ) + { + g_p_file_substrs = NULL; + } + return 0; +} + +// closes the current open sub string file and frees +// the current sub string list +// returns 1 on success, 0 on failure +int Close_SubStringFile() +{ + if( g_p_file_substrs ) + { + // close the file + if( fclose( g_p_file_substrs ) == 0 ) + { + // success + g_p_file_substrs = NULL; + return 1; + } + + printf( "[Close_SubStringFile] Error closing file\n" ); + return 0; + } + + printf( "[Close_SubStringFile] Error, never opened \n" ); + return 0; +} + +#if 0 + +void OpenStringFile( const char * p_path ) +{ +} + +void CreateStringFile( const char * p_path ) +{ +} + +void AddStringsFromFile( const char * p_path ) +{ +} + +#endif + +// given a plain text files, extracts any unique sub strings +// and adds them into the current sub string list +// +// returns 1 on success, 0 on failure +int Add_SubStringsFromFile( const char * p_path ) +{ + FILE * p_file = fopen( p_path, "rt" ); + if( p_file ) + { + // build a new substring list from the file + if( BuildFromFile_SubStrings( &g_tempsubstrs1, p_file ) ) + { + // combine new substrings with current list + // into a new temporary list + // NOTE: this operation empties/frees + // both 'g_tempsubstrs1' and 'g_mainsubstrs' + Combine_SubStringLists( &g_tempsubstrs2, + &g_tempsubstrs1, + &g_mainsubstrs ); + + // remove duplicates from new temporary list + RemoveDuplicates_SubStrings( &g_tempsubstrs2 ); + + // move new temporary list into main list + // (also cleans memory a little) + // NOTE: this operation empties/frees 'g_tempsubstrs2' + Move_SubStrings( &g_mainsubstrs, &g_tempsubstrs2 ); + + // close the file + fclose( p_file ); + + // success + return 1; + } + + fclose( p_file ); + printf( "[Add_SubStringsFromFile] Error" ); + return 0; + } + + printf( "[Add_SubStringsFromFile] Error, cannot open file: %s.\n", p_path ); + return 0; +} + +// given a path, opens an existing sub string file +// (shoudl conatin an alphabetically sorted list of unique substrings) +// reads in the contents as the current sub string list and sets +// the file as the current open sub string file +// +// returns 1 on success, 0 on failure +int Open_SubStringFile( const char * p_path ) +{ + g_p_file_substrs = fopen( p_path, "r+t" ); + if( g_p_file_substrs ) + { + if( Create_SubStringList( &g_mainsubstrs, g_p_file_substrs ) ) + { + // success + return 1; + } + + fclose( g_p_file_substrs ); + printf( "[OpenSubStringFile] Error" ); + return 0; + } + + printf( "[OpenSubStringFile] Error, cannot open file: %s.\n", p_path ); + return 0; +} + +// given a path, creates a sub string file for writing to +// as the current open sub string file +// +// returns 1 on success, 0 on failure +int Create_SubStringFile( const char * p_path ) +{ + g_p_file_substrs = fopen( p_path, "w+t" ); + if( g_p_file_substrs ) + { + // free current list + Free_SubStringList( &g_mainsubstrs ); + + // success + return 1; + } + + printf( "[Create_SubStringFile] Error, cannot create file: %s.\n", p_path ); + return 0; +} + +// Resets *everything*, frees all memory in use, closes all open files +void MakeKSP_ResetAll() +{ + Free_SubStringList( &g_mainsubstrs ); + Free_SubStringList( &g_tempsubstrs1 ); + Free_SubStringList( &g_tempsubstrs2 ); + + if( g_p_file_substrs ) + { + fclose( g_p_file_substrs ); + g_p_file_substrs = NULL; + } +} \ No newline at end of file diff --git a/src/tools/make_kernel_string_pool.h b/src/tools/make_kernel_string_pool.h new file mode 100755 index 0000000..2cee201 --- /dev/null +++ b/src/tools/make_kernel_string_pool.h @@ -0,0 +1,64 @@ +/* + "make_kernel_string_pool.h" + + created by: grayspace aka J. Leveille + for: UbixOS Project + date: July 3, 2002 + + purpose: - tool to create string pools for in kernel use + - will generate the source for including a global + set of ASCII (for now) strings into the kernel + to avoid memory wastage for kernel output strings + for long lists of things such as device descriptions + + NOTEs: + - for now only ASCII is supported + + TODO: + - expand to support unicode + - use huffman encoding instead + + $Id$ +*/ + + +#ifndef _MAKE_KERNEL_STRING_POOL_H +#define _MAKE_KERNEL_STRING_POOL_H + + +// Resets *everything*, frees all memory in use, closes all open files +void MakeKSP_ResetAll(); + +// given a path, creates a sub string file for writing to +// as the current open sub string file +// +// returns 1 on success, 0 on failure +int Create_SubStringFile( const char * p_path ); + +// writes out and closes the current sub string file if possible +// and frees the current sub string list +// returns 1 on success, 0 on failure +int WriteAndClose_SubStringFile(); + +// closes the current open sub string file and frees +// the current sub string list +// returns 1 on success, 0 on failure +int Close_SubStringFile(); + +// given a path, opens an existing sub string file +// (shoudl conatin an alphabetically sorted list of unique substrings) +// reads in the contents as the current sub string list and sets +// the file as the current open sub string file +// +// returns 1 on success, 0 on failure +int Open_SubStringFile( const char * p_path ); + +// given a plain text files, extracts any unique sub strings +// and adds them into the current sub string list +// +// returns 1 on success, 0 on failure +int Add_SubStringsFromFile( const char * p_path ); + + + +#endif // _MAKE_KERNEL_STRING_POOL_H diff --git a/ubixos.kdevprj b/ubixos.kdevprj index bb7e758..8bc0fd4 100755 --- a/ubixos.kdevprj +++ b/ubixos.kdevprj @@ -44,7 +44,7 @@ kdevprj_version=1.3 lfv_open_groups=Others make_options=\s-j1 clean all install -makefiles=./Makefile.am,src/Makefile.am,src/sys/Makefile.am,src/sys/include/Makefile.am,src/lib/Makefile.am,src/lib/libc/Makefile.am,src/lib/libc/include/Makefile.am,src/bin/Makefile.am,src/bin/shell/Makefile.am,Makefile.am,src/sys/boot/Makefile.am,src/sys/init/Makefile.am,src/sys/include/ubixos/Makefile.am,src/sys/drivers/Makefile.am,src/sys/kernel/Makefile.am,src/sys/compile/Makefile.am,src/sys/include/version/Makefile.am,src/sys/include/drivers/Makefile.am,src/sys/vmm/Makefile.am,src/sys/include/vmm/Makefile.am,src/sys/include/ubixfs/Makefile.am,src/sys/ubixfs/Makefile.am,src/tools/Makefile.am,src/bin/init/Makefile.am,src/lib/libc/stdio/Makefile.am,src/lib/libc/include/sys/Makefile.am,src/lib/libc/sys/Makefile.am,src/lib/libc/stdlib/Makefile.am +makefiles=./Makefile.am,src/Makefile.am,src/sys/Makefile.am,src/sys/include/Makefile.am,src/lib/Makefile.am,src/lib/libc/Makefile.am,src/lib/libc/include/Makefile.am,src/bin/Makefile.am,src/bin/shell/Makefile.am,Makefile.am,src/sys/boot/Makefile.am,src/sys/init/Makefile.am,src/sys/include/ubixos/Makefile.am,src/sys/drivers/Makefile.am,src/sys/kernel/Makefile.am,src/sys/compile/Makefile.am,src/sys/include/version/Makefile.am,src/sys/include/drivers/Makefile.am,src/sys/vmm/Makefile.am,src/sys/include/vmm/Makefile.am,src/sys/include/ubixfs/Makefile.am,src/sys/ubixfs/Makefile.am,src/tools/Makefile.am,src/bin/init/Makefile.am,src/lib/libc/stdio/Makefile.am,src/lib/libc/include/sys/Makefile.am,src/lib/libc/sys/Makefile.am,src/lib/libc/stdlib/Makefile.am,src/sys/misc/Makefile.am,src/sys/deviceman/Makefile.am,src/grayspace-misc/Makefile.am,src/sys/include/deviceman/Makefile.am,src/sys/include/misc/Makefile.am modifyMakefiles=true project_name=UbixOS project_type=normal_empty @@ -94,7 +94,7 @@ [src/Makefile.am] files= -sub_dirs=sys,lib,bin,tools +sub_dirs=sys,lib,bin,tools,grayspace-misc type=normal [src/bin/Makefile] @@ -142,6 +142,17 @@ install_location= type=SOURCE +[src/grayspace-misc/Makefile.am] +files=src/grayspace-misc/gsdefines.h +sub_dirs= +type=normal + +[src/grayspace-misc/gsdefines.h] +dist=true +install=false +install_location= +type=HEADER + [src/lib/Makefile.am] sub_dirs=libc, type=normal @@ -310,7 +321,7 @@ [src/sys/Makefile.am] files=src/sys/Makefile -sub_dirs=include,boot,init,drivers,kernel,compile,vmm,ubixfs +sub_dirs=include,boot,init,drivers,kernel,compile,vmm,ubixfs,misc,deviceman type=normal [src/sys/boot/Makefile] @@ -341,6 +352,23 @@ sub_dirs= type=normal +[src/sys/deviceman/Makefile] +dist=true +install=false +install_location= +type=DATA + +[src/sys/deviceman/Makefile.am] +files=src/sys/deviceman/Makefile,src/sys/deviceman/bus_resources_portio.c +sub_dirs= +type=static_library + +[src/sys/deviceman/bus_resources_portio.c] +dist=true +install=false +install_location= +type=SOURCE + [src/sys/drivers/8259.c] dist=true install=false @@ -378,9 +406,44 @@ [src/sys/include/Makefile.am] files=src/sys/include/stdarg.h -sub_dirs=ubixos,version,drivers,vmm,ubixfs +sub_dirs=ubixos,version,drivers,vmm,ubixfs,deviceman,misc type=normal +[src/sys/include/deviceman/Makefile.am] +files=src/sys/include/deviceman/bus.h,src/sys/include/deviceman/bus_resources.h,src/sys/include/deviceman/bus_resources_portio.h,src/sys/include/deviceman/device.h,src/sys/include/deviceman/isapnp.h +sub_dirs= +type=normal + +[src/sys/include/deviceman/bus.h] +dist=true +install=false +install_location= +type=HEADER + +[src/sys/include/deviceman/bus_resources.h] +dist=true +install=false +install_location= +type=HEADER + +[src/sys/include/deviceman/bus_resources_portio.h] +dist=true +install=false +install_location= +type=HEADER + +[src/sys/include/deviceman/device.h] +dist=true +install=false +install_location= +type=HEADER + +[src/sys/include/deviceman/isapnp.h] +dist=true +install=false +install_location= +type=HEADER + [src/sys/include/drivers/8259.h] dist=true install=false @@ -410,6 +473,23 @@ install_location= type=HEADER +[src/sys/include/misc/Makefile.am] +files=src/sys/include/misc/kernel_string_pool.h,src/sys/include/misc/misc_bit_array.h +sub_dirs= +type=normal + +[src/sys/include/misc/kernel_string_pool.h] +dist=true +install=false +install_location= +type=HEADER + +[src/sys/include/misc/misc_bit_array.h] +dist=true +install=false +install_location= +type=HEADER + [src/sys/include/stdarg.h] dist=true install=false @@ -434,7 +514,7 @@ type=HEADER [src/sys/include/ubixos/Makefile.am] -files=src/sys/include/ubixos/gdt.h,src/sys/include/ubixos/io.h,src/sys/include/ubixos/idt.h,src/sys/include/ubixos/exec.h,src/sys/include/ubixos/schedule.h,src/sys/include/ubixos/types.h,src/sys/include/ubixos/dma.h,src/sys/include/ubixos/idlethread.h,src/sys/include/ubixos/elf.h,src/sys/include/ubixos/syscall.h,src/sys/include/ubixos/syscalls.h,src/sys/include/ubixos/a.out.h,src/sys/include/ubixos/fork.h,src/sys/include/ubixos/bios32.h +files=src/sys/include/ubixos/gdt.h,src/sys/include/ubixos/io.h,src/sys/include/ubixos/idt.h,src/sys/include/ubixos/exec.h,src/sys/include/ubixos/schedule.h,src/sys/include/ubixos/types.h,src/sys/include/ubixos/dma.h,src/sys/include/ubixos/idlethread.h,src/sys/include/ubixos/elf.h,src/sys/include/ubixos/syscall.h,src/sys/include/ubixos/syscalls.h,src/sys/include/ubixos/a.out.h sub_dirs= type=normal @@ -444,12 +524,6 @@ install_location= type=HEADER -[src/sys/include/ubixos/bios32.h] -dist=true -install=false -install_location= -type=HEADER - [src/sys/include/ubixos/dma.h] dist=true install=false @@ -468,12 +542,6 @@ install_location= type=HEADER -[src/sys/include/ubixos/fork.h] -dist=true -install=false -install_location= -type=HEADER - [src/sys/include/ubixos/gdt.h] dist=true install=false @@ -576,7 +644,7 @@ type=DATA [src/sys/kernel/Makefile.am] -files=src/sys/kernel/Makefile,src/sys/kernel/io.c,src/sys/kernel/version.c,src/sys/kernel/kprintf.c,src/sys/kernel/vsprintf.c,src/sys/kernel/idt.c,src/sys/kernel/exec.c,src/sys/kernel/schedule.c,src/sys/kernel/dma.c,src/sys/kernel/idlethread.c,src/sys/kernel/syscall.c,src/sys/kernel/fork.c +files=src/sys/kernel/Makefile,src/sys/kernel/io.c,src/sys/kernel/version.c,src/sys/kernel/kprintf.c,src/sys/kernel/vsprintf.c,src/sys/kernel/idt.c,src/sys/kernel/exec.c,src/sys/kernel/schedule.c,src/sys/kernel/dma.c,src/sys/kernel/idlethread.c,src/sys/kernel/syscall.c sub_dirs= type=static_library @@ -592,12 +660,6 @@ install_location= type=SOURCE -[src/sys/kernel/fork.c] -dist=true -install=false -install_location= -type=SOURCE - [src/sys/kernel/idlethread.c] dist=true install=false @@ -646,8 +708,39 @@ install_location= type=SOURCE +[src/sys/misc/Makefile] +dist=true +install=false +install_location= +type=DATA + +[src/sys/misc/Makefile.am] +files=src/sys/misc/kernel_string_pool.c,src/sys/misc/misc_bit_array.c,src/sys/misc/Makefile +sharedlib_LDFLAGS=-version-info 0:0:1 +sharedlib_rootname=misc +sub_dirs= +type=static_library + +[src/sys/misc/kernel_string_pool.c] +dist=true +install=false +install_location= +type=SOURCE + +[src/sys/misc/misc_bit_array.c] +dist=true +install=false +install_location= +type=SOURCE + +[src/sys/ubixfs/Makefile] +dist=true +install=false +install_location= +type=DATA + [src/sys/ubixfs/Makefile.am] -files=src/sys/ubixfs/ubixfs.c,src/sys/ubixfs/file.c +files=src/sys/ubixfs/ubixfs.c,src/sys/ubixfs/file.c,src/sys/ubixfs/Makefile sharedlib_LDFLAGS=-version-info 0:0:1 sharedlib_rootname=ubixfs sub_dirs= @@ -688,15 +781,51 @@ install_location= type=SOURCE +[src/tools/Makefile] +dist=true +install=false +install_location= +type=DATA + [src/tools/Makefile.am] -files=src/tools/format.c +files=src/tools/format.c,src/tools/ubixfs.h,src/tools/Makefile,src/tools/build_isa_pnp_files.c,src/tools/build_isa_pnp_files.h,src/tools/make_kernel_string_pool.c,src/tools/make_kernel_string_pool.h sharedlib_LDFLAGS=-version-info 0:0:1 sharedlib_rootname=tools sub_dirs= type=static_library +[src/tools/build_isa_pnp_files.c] +dist=true +install=false +install_location= +type=SOURCE + +[src/tools/build_isa_pnp_files.h] +dist=true +install=false +install_location= +type=HEADER + [src/tools/format.c] dist=true install=false install_location= type=SOURCE + +[src/tools/make_kernel_string_pool.c] +dist=true +install=false +install_location= +type=SOURCE + +[src/tools/make_kernel_string_pool.h] +dist=true +install=false +install_location= +type=HEADER + +[src/tools/ubixfs.h] +dist=true +install=false +install_location= +type=HEADER