Home  >  Article  >  Technology peripherals  >  ChatGPT retro gameplay: 39 years old computer + DOS system can also be played

ChatGPT retro gameplay: 39 years old computer + DOS system can also be played

王林
王林forward
2023-04-04 13:10:051471browse

MS-DOS is a very challenging platform for the ChatGPT client.

When ChatGPT encounters MS-DOS system, you may have a feeling of traveling back in time.

Recently, Singaporean retro computer enthusiast Yeo Kheng Meng released a MS-DOS ChatGPT client that can run on a 4.77MHz IBM PC, providing a unique communication method for ChatGPT.

ChatGPT retro gameplay: 39 years old computer + DOS system can also be played

MS-DOS is a very challenging platform for the ChatGPT client because it lacks native networking capabilities. Furthermore, Yeo targeted a computer with very limited processing power: the IBM 5155 from 1984. Internally it contains an Intel 8088 4.77 MHz CPU, 640KB of conventional memory, CGA ISA graphics card and MS-DOS 6.22 system.

The IBM 5155 is a portable computer with a suitcase-like shell design and a foldable handle for easy portability.

To create the client, Yeo used Open Watcom C/C, a modern compiler that runs on Windows 11 and can target 16-bit DOS platforms. For testing, he used a VirtualBox virtual machine running DOS 6.22 to simplify the development process, and then he transferred the compiled binaries to a target IBM DOS PC for testing.

In order to deal with network problems on IBM PC, Yeo has made various efforts. First, he took advantage of the "Packet Driver API" standard invented in 1983. He integrated Michael B. Brutman's open source MTCP library into the application to communicate with the Packet Driver to provide network functionality to the client.

For the ChatGPT API, Yeo used OpenAI’s Chat Completion API, manually building the POST request in C (and parsing the JSON-formatted response).

However, Yeo encountered a huge obstacle: ChatGPT’s API requires an encrypted HTTPS connection. Since MS-DOS does not have a native HTTPS library, Yeo created an HTTP-to-HTTPS proxy that can run on modern computers and translate requests and responses between MS-DOS clients and ChatGPT's secure API during the communication process act as a transparent middleman.

ChatGPT retro gameplay: 39 years old computer + DOS system can also be played

#Yeo said reading and writing input to the console was another challenge due to the single-threaded nature of DOS applications. He devised a way to check and receive keystrokes without pausing the program, using the MTCP page and online samples as a reference.

In the end, the client turned out better than Yeo expected. He describes his development process in a more detailed blog post.

ChatGPT retro gameplay: 39 years old computer + DOS system can also be played

Blog address: https://yeokhengmeng.com/2023/03/building-a-dos-chatgpt-client-in-2023/

Related code participates in GitHub project:

ChatGPT retro gameplay: 39 years old computer + DOS system can also be played

Project address: https://github.com/yeokm1/doschgpt

The above is the detailed content of ChatGPT retro gameplay: 39 years old computer + DOS system can also be played. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:51cto.com. If there is any infringement, please contact admin@php.cn delete