mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-10 04:52:14 -04:00
Start playing in qemu user networking mode for now
This commit is contained in:
parent
7ac53f6cd0
commit
0fe68abc80
7
Makefile
7
Makefile
@ -51,6 +51,13 @@ qemu: default
|
|||||||
tail -f virtual.log
|
tail -f virtual.log
|
||||||
kill %1
|
kill %1
|
||||||
|
|
||||||
|
qemu_user: default
|
||||||
|
touch virtual.log
|
||||||
|
sudo qemu-system-x86_64 -enable-kvm -cpu host -serial file:virtual.log -netdev user,id=thor_net0 -device rtl8139,netdev=thor_net0,id=thor_nic0 -vga std -hda hdd.img &
|
||||||
|
echo "Reading kernel log (Ctrl+C for exit)"
|
||||||
|
tail -f virtual.log
|
||||||
|
kill %1
|
||||||
|
|
||||||
bochs: default
|
bochs: default
|
||||||
echo "c" > commands
|
echo "c" > commands
|
||||||
bochs -qf tools/bochsrc.txt -rc commands
|
bochs -qf tools/bochsrc.txt -rc commands
|
||||||
|
@ -85,7 +85,7 @@ void network::arp::decode(network::interface_descriptor& interface, network::eth
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(operation == 0x1){
|
if(operation == 0x1){
|
||||||
if(target_prot == network::ip::make_address(192,168,20,66)){
|
if(target_prot == network::ip::make_address(10,0,2,15)){
|
||||||
logging::logf(logging::log_level::TRACE, "arp: Reply to Request for own IP\n");
|
logging::logf(logging::log_level::TRACE, "arp: Reply to Request for own IP\n");
|
||||||
|
|
||||||
// Ask the ethernet layer to craft a packet
|
// Ask the ethernet layer to craft a packet
|
||||||
|
@ -37,7 +37,7 @@ void network::icmp::ping(network::interface_descriptor& interface, network::ip::
|
|||||||
arp_request_header->source_hw_addr[i] = switch_endian_16(uint16_t(source_mac >> ((2 - i) * 16)));
|
arp_request_header->source_hw_addr[i] = switch_endian_16(uint16_t(source_mac >> ((2 - i) * 16)));
|
||||||
}
|
}
|
||||||
|
|
||||||
network::ip::address source = network::ip::make_address(192, 168, 20, 66);
|
network::ip::address source = network::ip::make_address(10,0,2,15);
|
||||||
|
|
||||||
for(size_t i = 0; i < 2; ++i){
|
for(size_t i = 0; i < 2; ++i){
|
||||||
arp_request_header->source_protocol_addr[i] = (uint16_t(source(2*i+1)) << 8) + source(2*i);
|
arp_request_header->source_protocol_addr[i] = (uint16_t(source(2*i+1)) << 8) + source(2*i);
|
||||||
|
@ -337,7 +337,7 @@ void sc_ioctl(interrupt::syscall_regs* regs){
|
|||||||
|
|
||||||
void sc_alpha(interrupt::syscall_regs*){
|
void sc_alpha(interrupt::syscall_regs*){
|
||||||
if(network::number_of_interfaces()){
|
if(network::number_of_interfaces()){
|
||||||
network::icmp::ping(network::interface(0), network::ip::make_address(192, 168, 20, 201));
|
network::icmp::ping(network::interface(0), network::ip::make_address(10, 0, 2, 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user