It is quite a common problem when you find some PCMCIA card (or PCI or any other) which supposed to work with your vintage system under MS-DOS, but it turns out that there are simply no drivers for MS-DOS. Problem becomes even bigger when you realize that not only you, a miserable lamer, are not capable to write MS-DOS driver for this card, but even experienced programmers of today for various reasons also aren't able to do this.
So I questioned myself - but what about AI? Is ChatGPT or its numerous AI colleagues are capable to compose such a driver? Or maybe to translate available Windows driver into MS-DOS version?
I know, it may sound as a silly idea, but still, what if ... Have anyone already tried to do something like that? Is this even possible?
there is perhaps a chance, if you trained it specifically on similar stuff, but i would guess it would ve a huge challenge to explain the actual problem ut needs to solve. I think that if you are able to explain what it should do you might as well solve the entire problem yourself.
Imo AI is pretty useful for summarising large amounts of text data. thats pretty cool and useful. But it is rarely very good at producing anything unique, just variations of already existing stuff.
At best, AI is like your common manager at a large company, they act like they know anything but in reality its mostly just an act, smiles a lot and say generic things that is expected of it.
there is perhaps a chance, if you trained it specifically on similar stuff, but i would guess it would ve a huge challenge to explain the actual problem ut needs to solve. I think that if you are able to explain what it should do you might as well solve the entire problem yourself.
Imo AI is pretty useful for summarising large amounts of text data. thats pretty cool and useful. But it is rarely very good at producing anything unique, just variations of already existing stuff.
At best, AI is like your common manager at a large company, they act like they know anything but in reality its mostly just an act, smiles a lot and say generic things that is expected of it.
You're right. It would be too naive to expect from AI to compose a fully working driver. But what about composing some sort of generic driver maybe not for this specific device, but for a general type of these devices? And from there you already can continue alone tweaking and adjusting things.
Another thing that I want to believe that it might be possible, it's to train AI for translating Windows drivers into MS-DOS ones. Here also I do not believe there will be a perfect result, but at least Windows drivers have needed parameters of the specific device and therefore a result might become even closer to the working MS-DOS driver.
I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some generic framework code in C. It had nothing to do with PCMCIA, just very basic and universal header and footer. Out of bunch of text I understood that he was not going to write the code instead of me (:
And what kind of device do you want to enable? There are universal enablers for common devices like modems and Ethernet cards. If it's something more specific then the main difficulty is to understand what resources the card actually needs. It's sometimes possible to understand form the tuple data. Another problem could be custom chips used in the card. So opening it won't always give clues.
It really requires very deep understanding of how things work.
I've been tinkering with enabling a PCMCIA sound card, but stuck at the stage where it actually required some memory range to utilize. It was way beyond my knowledge.
Bondiwrote on 2024-12-12, 09:54:I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some g […] Show full quote
I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some generic framework code in C. It had nothing to do with PCMCIA, just very basic and universal header and footer. Out of bunch of text I understood that he was not going to write the code instead of me (:
And what kind of device do you want to enable? There are universal enablers for common devices like modems and Ethernet cards. If it's something more specific then the main difficulty is to understand what resources the card actually needs. It's sometimes possible to understand form the tuple data. Another problem could be custom chips used in the card. So opening it won't always give clues.
It really requires very deep understanding of how things work.
I've been tinkering with enabling a PCMCIA sound card, but stuck at the stage where it actually required some memory range to utilize. It was way beyond my knowledge.
I took a Canopus Power Window T64V PCMCIA Graphics Card for example and ChatGPT went a bit further.
First it gave me as you mentioned, some generic framework code in C called "Sample Driver Skeleton":
1#include <dos.h> 2#include <stdio.h> 3 4// Placeholder for T64V-specific registers and commands 5#define T64V_REGISTER_BASE 0xXYZ 6#define T64V_INIT_COMMAND 0x123 7#define T64V_MODE_REGISTER 0xABC 8#define T64V_MODE_VGA 0x01 9 10// Example function to write to a register 11void write_register(unsigned int port, unsigned char value) { 12 outp(port, value); 13} 14 15// Example function to initialize the card 16int initialize_card() { 17 // Detect card 18 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 19 20 // Perform other initialization 21 // ... 22 return 1; // Success 23} 24 25// Example function to set a graphics mode 26int set_graphics_mode(unsigned char mode) { 27 write_register(T64V_MODE_REGISTER, mode); 28 return 1; // Success 29} 30 31// Main entry point for testing 32void main() { 33 if (!initialize_card()) { 34 printf("Failed to initialize the T64V card.\n"); 35 return; 36 } 37 printf("Card initialized.\n"); 38 39 if (!set_graphics_mode(T64V_MODE_VGA)) { 40 printf("Failed to set graphics mode.\n"); 41 return; 42 } 43 printf("Graphics mode set.\n"); 44 45 // Add drawing or other operations here 46}
And then it gave me some more advanced code in C:
1/** 2 * MS-DOS Driver for Canopus Power Window T64V PCMCIA Graphics Card 3 * 4 * Note: This driver is a generic example and might require adjustments based on 5 * the actual hardware specifications of the T64V card. 6 */ 7 8#include <dos.h> 9#include <stdio.h> 10#include <stdlib.h> 11 12// Placeholder definitions (Replace with actual hardware details) 13#define T64V_REGISTER_BASE 0x300 // Base I/O port for the card (example) 14#define T64V_INIT_COMMAND 0x01 // Command to initialize the card 15#define T64V_MODE_REGISTER 0x302 // Register for setting display modes 16#define T64V_FRAME_BUFFER 0xA000 // Frame buffer base address (example) 17#define T64V_MODE_VGA 0x03 // Example mode: VGA 18 19// Function to write a value to a hardware register 20void write_register(unsigned int port, unsigned char value) { 21 outp(port, value); 22} 23 24// Function to read a value from a hardware register 25unsigned char read_register(unsigned int port) { 26 return inp(port); 27} 28 29// Function to initialize the graphics card 30int initialize_card() { 31 printf("Initializing T64V graphics card...\n"); 32 33 // Example: Write initialization command to the base register 34 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 35 36 // Example: Verify initialization 37 unsigned char status = read_register(T64V_REGISTER_BASE); 38 if (status != 0x01) { // Expected status after initialization 39 printf("Failed to initialize the card. Status: 0x%X\n", status); 40 return 0; // Failure 41 } 42 43 printf("Card initialized successfully.\n"); 44 return 1; // Success 45} 46 47// Function to set the graphics mode 48int set_graphics_mode(unsigned char mode) { 49 printf("Setting graphics mode to 0x%X...\n", mode); 50 51 write_register(T64V_MODE_REGISTER, mode); 52 53 // Example: Verify the mode setting 54 unsigned char current_mode = read_register(T64V_MODE_REGISTER); 55 if (current_mode != mode) { 56 printf("Failed to set graphics mode. Current mode: 0x%X\n", current_mode); 57 return 0; // Failure 58 } 59 60 printf("Graphics mode set successfully.\n");
…Show last 34 lines
61 return 1; // Success 62} 63 64// Function to clear the screen (basic frame buffer example) 65void clear_screen() { 66 printf("Clearing the screen...\n"); 67 68 unsigned char far *frame_buffer = (unsigned char far *)MK_FP(0xA000, 0x0000); 69 for (unsigned int i = 0; i < 64000; i++) { // Example: 320x200 resolution 70 frame_buffer[i] = 0x00; // Black 71 } 72 73 printf("Screen cleared.\n"); 74} 75 76// Main driver entry point 77void main() { 78 if (!initialize_card()) { 79 printf("Driver initialization failed.\n"); 80 exit(1); 81 } 82 83 if (!set_graphics_mode(T64V_MODE_VGA)) { 84 printf("Failed to set graphics mode.\n"); 85 exit(1); 86 } 87 88 clear_screen(); 89 90 printf("T64V driver loaded and ready.\n"); 91 92 // Additional drawing or operations can be added here 93}
IMHO, we should first consider some possible reasons playing against someone wanting to write such drivers.
Off the top of my head :
a) Is there a lack of needed low level documentation ?
b) Is lack of interest/motivation a factor ?
c) Is the hardware so completely unsuited to DOS use that one would need, for example, to modify or write a a Sound Blaster emulator and then have it interface with the hardware after having determined how to initialize it and interface with it under DOS (and having written code for that) ?
d) Does the potential overhead ( CPU, memory) make c impractical ?
e) Interfacing with Windows drivers under Linux has been done with WIFI cards in the past (NDISWrapper) with some success. Would doing something similar in real mode DOS, with no existing native APIs to convert to (need to reinvent the wheel, AFAIU) and having to do that on relatively slow retro hardware make for an even theoretically feasible solution ?
Which of the above challenges/issues (and others I am not thinking about) could AI actually be helpful with ?
ThinkpadILwrote on 2024-12-12, 12:02:I took a Canopus Power Window T64V PCMCIA Graphics Card for example and ChatGPT went a bit further. […] Show full quote
Bondiwrote on 2024-12-12, 09:54:I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some g […] Show full quote
I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some generic framework code in C. It had nothing to do with PCMCIA, just very basic and universal header and footer. Out of bunch of text I understood that he was not going to write the code instead of me (:
And what kind of device do you want to enable? There are universal enablers for common devices like modems and Ethernet cards. If it's something more specific then the main difficulty is to understand what resources the card actually needs. It's sometimes possible to understand form the tuple data. Another problem could be custom chips used in the card. So opening it won't always give clues.
It really requires very deep understanding of how things work.
I've been tinkering with enabling a PCMCIA sound card, but stuck at the stage where it actually required some memory range to utilize. It was way beyond my knowledge.
I took a Canopus Power Window T64V PCMCIA Graphics Card for example and ChatGPT went a bit further.
First it gave me as you mentioned, some generic framework code in C called "Sample Driver Skeleton":
1#include <dos.h> 2#include <stdio.h> 3 4// Placeholder for T64V-specific registers and commands 5#define T64V_REGISTER_BASE 0xXYZ 6#define T64V_INIT_COMMAND 0x123 7#define T64V_MODE_REGISTER 0xABC 8#define T64V_MODE_VGA 0x01 9 10// Example function to write to a register 11void write_register(unsigned int port, unsigned char value) { 12 outp(port, value); 13} 14 15// Example function to initialize the card 16int initialize_card() { 17 // Detect card 18 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 19 20 // Perform other initialization 21 // ... 22 return 1; // Success 23} 24 25// Example function to set a graphics mode 26int set_graphics_mode(unsigned char mode) { 27 write_register(T64V_MODE_REGISTER, mode); 28 return 1; // Success 29} 30 31// Main entry point for testing 32void main() { 33 if (!initialize_card()) { 34 printf("Failed to initialize the T64V card.\n"); 35 return; 36 } 37 printf("Card initialized.\n"); 38 39 if (!set_graphics_mode(T64V_MODE_VGA)) { 40 printf("Failed to set graphics mode.\n"); 41 return; 42 } 43 printf("Graphics mode set.\n"); 44 45 // Add drawing or other operations here 46}
And then it gave me some more advanced code in C:
1/** 2 * MS-DOS Driver for Canopus Power Window T64V PCMCIA Graphics Card 3 * 4 * Note: This driver is a generic example and might require adjustments based on 5 * the actual hardware specifications of the T64V card. 6 */ 7 8#include <dos.h> 9#include <stdio.h> 10#include <stdlib.h> 11 12// Placeholder definitions (Replace with actual hardware details) 13#define T64V_REGISTER_BASE 0x300 // Base I/O port for the card (example) 14#define T64V_INIT_COMMAND 0x01 // Command to initialize the card 15#define T64V_MODE_REGISTER 0x302 // Register for setting display modes 16#define T64V_FRAME_BUFFER 0xA000 // Frame buffer base address (example) 17#define T64V_MODE_VGA 0x03 // Example mode: VGA 18 19// Function to write a value to a hardware register 20void write_register(unsigned int port, unsigned char value) { 21 outp(port, value); 22} 23 24// Function to read a value from a hardware register 25unsigned char read_register(unsigned int port) { 26 return inp(port); 27} 28 29// Function to initialize the graphics card 30int initialize_card() { 31 printf("Initializing T64V graphics card...\n"); 32 33 // Example: Write initialization command to the base register 34 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 35 36 // Example: Verify initialization 37 unsigned char status = read_register(T64V_REGISTER_BASE); 38 if (status != 0x01) { // Expected status after initialization 39 printf("Failed to initialize the card. Status: 0x%X\n", status); 40 return 0; // Failure 41 } 42 43 printf("Card initialized successfully.\n"); 44 return 1; // Success 45} 46 47// Function to set the graphics mode 48int set_graphics_mode(unsigned char mode) { 49 printf("Setting graphics mode to 0x%X...\n", mode); 50 51 write_register(T64V_MODE_REGISTER, mode); 52 53 // Example: Verify the mode setting 54 unsigned char current_mode = read_register(T64V_MODE_REGISTER); 55 if (current_mode != mode) { 56 printf("Failed to set graphics mode. Current mode: 0x%X\n", current_mode); 57 return 0; // Failure 58 } 59 60 printf("Graphics mode set successfully.\n");
…Show last 34 lines
61 return 1; // Success 62} 63 64// Function to clear the screen (basic frame buffer example) 65void clear_screen() { 66 printf("Clearing the screen...\n"); 67 68 unsigned char far *frame_buffer = (unsigned char far *)MK_FP(0xA000, 0x0000); 69 for (unsigned int i = 0; i < 64000; i++) { // Example: 320x200 resolution 70 frame_buffer[i] = 0x00; // Black 71 } 72 73 printf("Screen cleared.\n"); 74} 75 76// Main driver entry point 77void main() { 78 if (!initialize_card()) { 79 printf("Driver initialization failed.\n"); 80 exit(1); 81 } 82 83 if (!set_graphics_mode(T64V_MODE_VGA)) { 84 printf("Failed to set graphics mode.\n"); 85 exit(1); 86 } 87 88 clear_screen(); 89 90 printf("T64V driver loaded and ready.\n"); 91 92 // Additional drawing or operations can be added here 93}
AFAIU, that's basically a barely pseudocode-like outline that would basically appy to any graphics card. There is nothing there that is even remotely hardware specific in there.
EDIT: In other words, it's a very high level list of the tasks that a theoretical graphics card initialization routine would need to go through. It does not address how to do any of these tasks.
ThinkpadILwrote on 2024-12-12, 12:02:I took a Canopus Power Window T64V PCMCIA Graphics Card for example and ChatGPT went a bit further. […] Show full quote
Bondiwrote on 2024-12-12, 09:54:I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some g […] Show full quote
I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some generic framework code in C. It had nothing to do with PCMCIA, just very basic and universal header and footer. Out of bunch of text I understood that he was not going to write the code instead of me (:
And what kind of device do you want to enable? There are universal enablers for common devices like modems and Ethernet cards. If it's something more specific then the main difficulty is to understand what resources the card actually needs. It's sometimes possible to understand form the tuple data. Another problem could be custom chips used in the card. So opening it won't always give clues.
It really requires very deep understanding of how things work.
I've been tinkering with enabling a PCMCIA sound card, but stuck at the stage where it actually required some memory range to utilize. It was way beyond my knowledge.
I took a Canopus Power Window T64V PCMCIA Graphics Card for example and ChatGPT went a bit further.
First it gave me as you mentioned, some generic framework code in C called "Sample Driver Skeleton":
1#include <dos.h> 2#include <stdio.h> 3 4// Placeholder for T64V-specific registers and commands 5#define T64V_REGISTER_BASE 0xXYZ 6#define T64V_INIT_COMMAND 0x123 7#define T64V_MODE_REGISTER 0xABC 8#define T64V_MODE_VGA 0x01 9 10// Example function to write to a register 11void write_register(unsigned int port, unsigned char value) { 12 outp(port, value); 13} 14 15// Example function to initialize the card 16int initialize_card() { 17 // Detect card 18 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 19 20 // Perform other initialization 21 // ... 22 return 1; // Success 23} 24 25// Example function to set a graphics mode 26int set_graphics_mode(unsigned char mode) { 27 write_register(T64V_MODE_REGISTER, mode); 28 return 1; // Success 29} 30 31// Main entry point for testing 32void main() { 33 if (!initialize_card()) { 34 printf("Failed to initialize the T64V card.\n"); 35 return; 36 } 37 printf("Card initialized.\n"); 38 39 if (!set_graphics_mode(T64V_MODE_VGA)) { 40 printf("Failed to set graphics mode.\n"); 41 return; 42 } 43 printf("Graphics mode set.\n"); 44 45 // Add drawing or other operations here 46}
And then it gave me some more advanced code in C:
1/** 2 * MS-DOS Driver for Canopus Power Window T64V PCMCIA Graphics Card 3 * 4 * Note: This driver is a generic example and might require adjustments based on 5 * the actual hardware specifications of the T64V card. 6 */ 7 8#include <dos.h> 9#include <stdio.h> 10#include <stdlib.h> 11 12// Placeholder definitions (Replace with actual hardware details) 13#define T64V_REGISTER_BASE 0x300 // Base I/O port for the card (example) 14#define T64V_INIT_COMMAND 0x01 // Command to initialize the card 15#define T64V_MODE_REGISTER 0x302 // Register for setting display modes 16#define T64V_FRAME_BUFFER 0xA000 // Frame buffer base address (example) 17#define T64V_MODE_VGA 0x03 // Example mode: VGA 18 19// Function to write a value to a hardware register 20void write_register(unsigned int port, unsigned char value) { 21 outp(port, value); 22} 23 24// Function to read a value from a hardware register 25unsigned char read_register(unsigned int port) { 26 return inp(port); 27} 28 29// Function to initialize the graphics card 30int initialize_card() { 31 printf("Initializing T64V graphics card...\n"); 32 33 // Example: Write initialization command to the base register 34 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 35 36 // Example: Verify initialization 37 unsigned char status = read_register(T64V_REGISTER_BASE); 38 if (status != 0x01) { // Expected status after initialization 39 printf("Failed to initialize the card. Status: 0x%X\n", status); 40 return 0; // Failure 41 } 42 43 printf("Card initialized successfully.\n"); 44 return 1; // Success 45} 46 47// Function to set the graphics mode 48int set_graphics_mode(unsigned char mode) { 49 printf("Setting graphics mode to 0x%X...\n", mode); 50 51 write_register(T64V_MODE_REGISTER, mode); 52 53 // Example: Verify the mode setting 54 unsigned char current_mode = read_register(T64V_MODE_REGISTER); 55 if (current_mode != mode) { 56 printf("Failed to set graphics mode. Current mode: 0x%X\n", current_mode); 57 return 0; // Failure 58 } 59 60 printf("Graphics mode set successfully.\n");
…Show last 34 lines
61 return 1; // Success 62} 63 64// Function to clear the screen (basic frame buffer example) 65void clear_screen() { 66 printf("Clearing the screen...\n"); 67 68 unsigned char far *frame_buffer = (unsigned char far *)MK_FP(0xA000, 0x0000); 69 for (unsigned int i = 0; i < 64000; i++) { // Example: 320x200 resolution 70 frame_buffer[i] = 0x00; // Black 71 } 72 73 printf("Screen cleared.\n"); 74} 75 76// Main driver entry point 77void main() { 78 if (!initialize_card()) { 79 printf("Driver initialization failed.\n"); 80 exit(1); 81 } 82 83 if (!set_graphics_mode(T64V_MODE_VGA)) { 84 printf("Failed to set graphics mode.\n"); 85 exit(1); 86 } 87 88 clear_screen(); 89 90 printf("T64V driver loaded and ready.\n"); 91 92 // Additional drawing or operations can be added here 93}
I think in theory if you could feed AI with relevant extracts of this book it would be possible to go ahead and start writing the suggested procedures. At the same time worth trying to dump the tuple data of the card and see if AI can make any practical conclusions of it. https://www.ebay.com/itm/126288588424?_skw=PC … ABk9SR9r9q7D3ZA
This is one of the better books afaik.
ThinkpadILwrote on 2024-12-12, 12:02:I took a Canopus Power Window T64V PCMCIA Graphics Card for example and ChatGPT went a bit further. […] Show full quote
Bondiwrote on 2024-12-12, 09:54:I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some g […] Show full quote
I remember asking once ChatGPT if he could help to write a PCMCIA driver. He said that it was very complicated, suggested some generic framework code in C. It had nothing to do with PCMCIA, just very basic and universal header and footer. Out of bunch of text I understood that he was not going to write the code instead of me (:
And what kind of device do you want to enable? There are universal enablers for common devices like modems and Ethernet cards. If it's something more specific then the main difficulty is to understand what resources the card actually needs. It's sometimes possible to understand form the tuple data. Another problem could be custom chips used in the card. So opening it won't always give clues.
It really requires very deep understanding of how things work.
I've been tinkering with enabling a PCMCIA sound card, but stuck at the stage where it actually required some memory range to utilize. It was way beyond my knowledge.
I took a Canopus Power Window T64V PCMCIA Graphics Card for example and ChatGPT went a bit further.
First it gave me as you mentioned, some generic framework code in C called "Sample Driver Skeleton":
1#include <dos.h> 2#include <stdio.h> 3 4// Placeholder for T64V-specific registers and commands 5#define T64V_REGISTER_BASE 0xXYZ 6#define T64V_INIT_COMMAND 0x123 7#define T64V_MODE_REGISTER 0xABC 8#define T64V_MODE_VGA 0x01 9 10// Example function to write to a register 11void write_register(unsigned int port, unsigned char value) { 12 outp(port, value); 13} 14 15// Example function to initialize the card 16int initialize_card() { 17 // Detect card 18 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 19 20 // Perform other initialization 21 // ... 22 return 1; // Success 23} 24 25// Example function to set a graphics mode 26int set_graphics_mode(unsigned char mode) { 27 write_register(T64V_MODE_REGISTER, mode); 28 return 1; // Success 29} 30 31// Main entry point for testing 32void main() { 33 if (!initialize_card()) { 34 printf("Failed to initialize the T64V card.\n"); 35 return; 36 } 37 printf("Card initialized.\n"); 38 39 if (!set_graphics_mode(T64V_MODE_VGA)) { 40 printf("Failed to set graphics mode.\n"); 41 return; 42 } 43 printf("Graphics mode set.\n"); 44 45 // Add drawing or other operations here 46}
And then it gave me some more advanced code in C:
1/** 2 * MS-DOS Driver for Canopus Power Window T64V PCMCIA Graphics Card 3 * 4 * Note: This driver is a generic example and might require adjustments based on 5 * the actual hardware specifications of the T64V card. 6 */ 7 8#include <dos.h> 9#include <stdio.h> 10#include <stdlib.h> 11 12// Placeholder definitions (Replace with actual hardware details) 13#define T64V_REGISTER_BASE 0x300 // Base I/O port for the card (example) 14#define T64V_INIT_COMMAND 0x01 // Command to initialize the card 15#define T64V_MODE_REGISTER 0x302 // Register for setting display modes 16#define T64V_FRAME_BUFFER 0xA000 // Frame buffer base address (example) 17#define T64V_MODE_VGA 0x03 // Example mode: VGA 18 19// Function to write a value to a hardware register 20void write_register(unsigned int port, unsigned char value) { 21 outp(port, value); 22} 23 24// Function to read a value from a hardware register 25unsigned char read_register(unsigned int port) { 26 return inp(port); 27} 28 29// Function to initialize the graphics card 30int initialize_card() { 31 printf("Initializing T64V graphics card...\n"); 32 33 // Example: Write initialization command to the base register 34 write_register(T64V_REGISTER_BASE, T64V_INIT_COMMAND); 35 36 // Example: Verify initialization 37 unsigned char status = read_register(T64V_REGISTER_BASE); 38 if (status != 0x01) { // Expected status after initialization 39 printf("Failed to initialize the card. Status: 0x%X\n", status); 40 return 0; // Failure 41 } 42 43 printf("Card initialized successfully.\n"); 44 return 1; // Success 45} 46 47// Function to set the graphics mode 48int set_graphics_mode(unsigned char mode) { 49 printf("Setting graphics mode to 0x%X...\n", mode); 50 51 write_register(T64V_MODE_REGISTER, mode); 52 53 // Example: Verify the mode setting 54 unsigned char current_mode = read_register(T64V_MODE_REGISTER); 55 if (current_mode != mode) { 56 printf("Failed to set graphics mode. Current mode: 0x%X\n", current_mode); 57 return 0; // Failure 58 } 59 60 printf("Graphics mode set successfully.\n");
…Show last 34 lines
61 return 1; // Success 62} 63 64// Function to clear the screen (basic frame buffer example) 65void clear_screen() { 66 printf("Clearing the screen...\n"); 67 68 unsigned char far *frame_buffer = (unsigned char far *)MK_FP(0xA000, 0x0000); 69 for (unsigned int i = 0; i < 64000; i++) { // Example: 320x200 resolution 70 frame_buffer[i] = 0x00; // Black 71 } 72 73 printf("Screen cleared.\n"); 74} 75 76// Main driver entry point 77void main() { 78 if (!initialize_card()) { 79 printf("Driver initialization failed.\n"); 80 exit(1); 81 } 82 83 if (!set_graphics_mode(T64V_MODE_VGA)) { 84 printf("Failed to set graphics mode.\n"); 85 exit(1); 86 } 87 88 clear_screen(); 89 90 printf("T64V driver loaded and ready.\n"); 91 92 // Additional drawing or operations can be added here 93}
AFAIU, that's basically a barely pseudocode-like outline that would basically appy to any graphics card. There is nothing there that is even remotely hardware specific in there.
EDIT: In other words, it's a very high level list of the tasks that a theoretical graphics card initialization routine would need to go through. It does not address how to do any of these tasks.
Yes, of course it is not a working driver code, not even close to a driver code at all, but still, it is already something, cause if you google you won't find even such a primitive pseudocode. And since, as I understand, AI is a system that is capable of learning from available data, why can't it be used for generating a code based on available literature, forums, datasheets and Windows drivers for the specific hardware?
There is also this book, that is very good. But it doesn't have sample code, unlike the other one I gave a link to.
The attachment pcmcia-system-architecture-16-bit-pc-cards-2nbsped-0201409917_compress.rar is no longer available
Thank you for giving a link to those books, they look like being a really good references. But still, my idea is to use AI as much as it is possible in order to avoid the stages in DOS driver development that can be done using AI.
There is also this book, that is very good. But it doesn't have sample code, unlike the other one I gave a link to.
The attachment pcmcia-system-architecture-16-bit-pc-cards-2nbsped-0201409917_compress.rar is no longer available
Thank you for giving a link to those books, they look like being a really good references. But still, my idea is to use AI as much as it is possible in order to avoid the stages in DOS driver development that can be done using AI.
I see your point, however I don't think AI actually knows how to do it. I mean it doesn't know for instance that the registers of PCIC are 3E0 and 3E1 and what values to write to them. This info isn't really on the internet. At least not the complete registers table. Or even if it's there it may not be in the AI'd database. So my idea is to give AI some kind of a reference.
Yes, of course it is not a working driver code, not even close to a driver code at all, but still, it is already something, cause if you google you won't find even such a primitive pseudocode. And since, as I understand, AI is a system that is capable of learning from available data, why can't it be used for generating a code based on available literature, forums, datasheets and Windows drivers for the specific hardware?
I think you give 'AI' more credit than it deserves at present.
Most of what people refer to as 'AI' are large language models, and this really doesn't involve intelligence as you or I classify it. You have to think of it more as the-most-advanced-text-prediction engine you've ever seen.
Yes, you could feed it those resources, but it won't know what to do with them - in the context of wanting it to generate some code for you, then you would have to have fed it similar code before - it isn't capable of making the leap from reading a datasheet to knowing that is has to write to a given port before it can read a byte from another region in the address apce (for example), and that doing so for Watcom vs GCC is different. It needs to have seen similar examples first. And preferably LOTS of them.
Yes, of course it is not a working driver code, not even close to a driver code at all, but still, it is already something, cause if you google you won't find even such a primitive pseudocode. And since, as I understand, AI is a system that is capable of learning from available data, why can't it be used for generating a code based on available literature, forums, datasheets and Windows drivers for the specific hardware?
I think you give 'AI' more credit than it deserves at present.
Most of what people refer to as 'AI' are large language models, and this really doesn't involve intelligence as you or I classify it. You have to think of it more as the-most-advanced-text-prediction engine you've ever seen.
Yes, you could feed it those resources, but it won't know what to do with them - in the context of wanting it to generate some code for you, then you would have to have fed it similar code before - it isn't capable of making the leap from reading a datasheet to knowing that is has to write to a given port before it can read a byte from another region in the address apce (for example), and that doing so for Watcom vs GCC is different. It needs to have seen similar examples first. And preferably LOTS of them.
Yes, it seems that you're right and AI is hugely overrated. Though, it is quite strange, why it should be a problem for AI to learn to design a program. After all AI is a machine and it should understand other machines better than humans do. Also, while learning, AI could also ask for the missing information on the forums like this. It is a natural thing to do, to ask others, and I really wonder why AI still is not able to do it.
Intelligence and agency are separate factors, which is how we have overachievers and underachievers. You're the agent, and zeroshotting ChatGPT for a device driver is underachieving. Instead start from a high level plan and go one step at a time. Consider more suitable AI models, and be prepared to run tests and provide feedback. Or wait for agentic AIs that take you out of the equation.
Yes, it seems that you're right and AI is hugely overrated. Though, it is quite strange, why it should be a problem for AI to learn to design a program. After all AI is a machine and it should understand other machines better than humans do. Also, while learning, AI could also ask for the missing information on the forums like this. It is a natural thing to do, to ask others, and I really wonder why AI still is not able to do it.
It's overated because the press and media love to exaggerate; because many fresh graduates have little appreciation of the history of science, maths, statistics and computer science, so they exaggerate what AI includes; because researchers want grants and companies want profits so they all exaggerate the potential. So you have to work a bit yourself to understand what it's reasonable to expect AI to be capable of, and to understand what it can and cannot do and should and should not be used for.