Start playing in qemu user networking mode for now

This commit is contained in:
Baptiste Wicht 2016-08-22 20:57:10 +02:00
parent 7ac53f6cd0
commit 0fe68abc80
4 changed files with 10 additions and 3 deletions

View File

@ -51,6 +51,13 @@ qemu: default
tail -f virtual.log
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
echo "c" > commands
bochs -qf tools/bochsrc.txt -rc commands

View File

@ -85,7 +85,7 @@ void network::arp::decode(network::interface_descriptor& interface, network::eth
}
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");
// Ask the ethernet layer to craft a packet

View File

@ -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)));
}
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){
arp_request_header->source_protocol_addr[i] = (uint16_t(source(2*i+1)) << 8) + source(2*i);

View File

@ -337,7 +337,7 @@ void sc_ioctl(interrupt::syscall_regs* regs){
void sc_alpha(interrupt::syscall_regs*){
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));
}
}