General Motors Corp., the world's largest auto maker, yesterday took a giant step toward becoming one of the world's biggest computer services companies by agreeing to acquire all of Texas billionaire H. Ross Perot's Electronic Data Systems Corp. in a $2.5 billion transaction.

The proposed buyout, subject to approval by the boards of both companies and by EDS shareholders, is a key move in GM's long-range strategy to derive at least 10 percent of its annual worldwide revenue from nonautomotive sources. Only about 3.5 percent of GM's worldwide 1983 sales of $74.6 billion came from outside the auto industry.

"EDS's expertise in many of its current lines of business . . . will have an immediate positive impact on the efficiency of selected GM activities," said GM Chairman Roger B. Smith. GM could now become "the largest and most technologically advanced computer services company in the world," he asserted.

GM and the 22-year-old EDS have been in intense negotiations for about a month. EDS offers both business and government agencies a comprehensive array of data processing services, including payroll and health claims processing.

Perot is an ex-IBM salesman who launched EDS after he discovered that many of his IBM customers didn't want the problems that went along with having a data processing department. His innovation was to manage the computer facilities for them.

Perot, a slight, close-cropped Texan, made a monumental impact on Wall Street with the sudden success of EDS in the late 1960s. And when its stock plummeted in 1970, his paper stock market loss was $450 million. (He remained a billionaire.) Flamboyant and unabashedly patriotic, Perot gained international fame by engineering a daring and successful 1979 commando rescue of two EDS employes from a Tehran jail.

Perot said the merger "will result in an extremely effective worldwide voice and data communications network, which will reduce costs and provide outstanding additional business opportunities in the high-technology industry."

Under the proposed agreement, Perot would continue serving as chairman of EDS and would report directly to Smith. The computer company would operate as an independent subsidiary of GM and would keep its Dallas headquarters.

EDS sources said Perot also will be offered a seat on GM's 25-member board of directors. GM officials said such an offer would have to come from the directors themselves, who are scheduled to meet next week.

EDS--which has an international payroll of 14,000 people, about 3,000 of them in the Washington area--grossed $651.5 million last year. Perot has forecast it will be a billion-dollar company by 1986.

"EDS is one of the best companies in the [computer services] group," said Ulric Weil, a principal at Morgan Stanley who researches the computer industry. "It has a nice niche in the medical-claims market." Almost half of EDS's revenue comes from its health- and insurance-related claims processing.

"Computer services companies can be interesting acquisitions for manufacturing companies with dispersed operations," Weil said. "A good computer services company can be a shortcut to improving a big company's internal data processing," as well as a means to diversify.

Weil said that McDonnell Douglas, the giant aviation company, recently acquired Tymshare, a California-based computer services company, as part of its diversification effort.

General Electric, Control Data Corp. and ADP Inc. of New Jersey are three of the other major players in the computer-services industry. Analysts estimate that the multibillion-dollar industry is growing at a 16 percent to 18 percent annual rate. EDS's growth rate has consistently exceeded 20 percent and the company has been moving aggressively to get defense contracts.

"The GM of the future will be a corporation . . . that goes after more defense business," Smith said in a 1983 address to The Newcomen Society of the United States, a corporate-history research group.

Smith said yesterday that GM will "apply EDS's systems and processing techniques throughout GM and thereby effect some very fundamental advances" in how the auto maker handles all phases of car orders--including the scheduling of car "build-dates," the kinds of accessories ordered for a particular model, and the invoicing and shipping of cars.

EDS also will handle the marketing of manufacturing systems--such as computer-aided manufacturing and computer-aided design operations--developed by GM, Smith said.

GM also recently paid $3 million to acquire an 11 percent share of Teknowledge Inc.--a California-based company that specializes in developing artificial intelligence systems designed to help computers "think" like humans.

GM, which has about $9 billion in cash and marketable securities, would buy EDS by paying $44 in cash for each of EDS's 58 million outstanding shares of common stock, or by paying $35.20 per share in cash plus two-tenths of a share of a new class of GM common stock called Class E common. If all were exchanged for GM's straight cash offer, the merger would cost the auto maker approximately $2.5 billion. Perot's family owns about 50 percent of the outstanding shares.

GM's Class E common would have one-half vote per share, one-half of the liquidation rights of GM common stock and would be publicly traded in an over-the-counter market or listed on a national securities exchange, GM officials said.

The officials said GM intends to issue up to 13.6 million shares of Class E common in the proposed merger. Up to four times that number of shares of Class E common would be issued about one year after the merger is approved, the officials said in a statement.