The two donations, announced Tuesday by President Barack Obama, are part of a package of commitments by seven U.S. companies valued at more than $750 million. Obama hailed the ConnectED program, which he initiated last summer, as a way to ensure that all students receive a high-quality education as they prepare to compete in the global economy.

"In a country where we expect free Wi-Fi with our coffee, we should definitely demand it in our schools," Obama said at a middle school in the Washington suburb of Adelphi, Md.

AT-T and Sprint each pledged more than $100 million in free wireless connections for middle- and high-school students, while Verizon will give up to $100 million in cash and services. Apple promised to give iPads, MacBooks and other devices worth $100 million to disadvantaged schools. Microsoft pledged to discount the price of its Windows operating system, decreasing the price of Windows-based devices.

O'Reilly Media will team with Safari Books Online, which it formed in 2001 as a joint venture with Pearson Education, to participate in the White House program. O'Reilly Media spokeswoman Sara Peyton declined to discuss the initiative and said no one from the company was available to speak Tuesday.

"Technical literacy is essential for today's students, if they're to succeed in school and in the work world," O'Reilly Media President Laura Baldwin said in a statement. "We're pleased to help them gain that knowledge, through this donation to America's schools."

The news comes one day after the Federal Communications Commission announced it would set aside $2 billion from service fees to connect 15,000 schools and 20 million students to high-speed Internet over two years.

Obama last year announced his goal of bringing high-speed Internet to 99 percent of students within five years. He used Tuesday's announcement as another example of how to act without waiting on Congress.

"We picked up the phone and we started asking some outstanding business leaders to help bring our schools and libraries into the 21st century," the president said.

The average school has the same Internet speed as an average home, but serves 200 times as many people, Obama said. About 30 percent of students have true high-speed Internet in their classrooms, compared with 100 percent of South Korean students, he said.

He said the pledges would put the world and outer space at every child's fingertips. Before the speech, Obama visited a seventh-grade classroom and noted one benefit of their Internet access: lighter knapsacks because they don't carry as many books to and from school.

"Sasha's book bag gets too big sometimes, hurts her back," he said of his younger daughter.

The initiative builds on Obama's focus for 2014 on helping more people join and stay in the middle class amid an economic recovery in which the benefits have come more quickly for those at the top of the income scale than for those toward the bottom.

Gene Sperling, a top White House economist, said every student needs high-speed Internet, but the problem is more pronounced in disadvantaged schools where students are less likely to have Internet connections at home. He said digital learning tools make it easier for schools to cater to the needs of students who need extra help or who are ahead of the curve.

He estimated that millions of students would benefit from the donations announced Tuesday.

For Obama, the commitments from the technology companies may help bolster his argument that despite opposition to much of his agenda from Congress, he can still be effective in his final years in office.

Obama has held similar events in recent days to announce commitments by entities outside of government to address long-term unemployment and expand access to higher education for low-income students.

"This for us really isn't about what Congress will or won't do," Rose Kirk, president of the Verizon Foundation, said in an interview. "It's really about the kids. I believe it makes perfect sense that we use our technology, our resources, our insight to have an impact."

The Associated Press contributed to this story.