Skip to content

Commit

Permalink
add power point
Browse files Browse the repository at this point in the history
  • Loading branch information
yhayun committed Jun 16, 2017
1 parent a4cf9b6 commit a1abc80
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
Binary file added 59108.ppt
Binary file not shown.
5 changes: 3 additions & 2 deletions kern/e1000.c~
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ int transmit_packet (void* package, int size){
e1000[E1000_TDT] = ( cur_desc + 1) % NUM_TRANS_DESC; // advance iterator TDT.

//make u-env sleep(yet runnnable) until the package is sent to it won't touch package mid transmit:
while ( !(tx_desc_list[cur_desc].status & E1000_TXD_STAT_DD) ){
//while ( !(tx_desc_list[cur_desc].status & E1000_TXD_STAT_DD) ){
sched_yield();
}
//}


return 0;
Expand Down Expand Up @@ -269,6 +269,7 @@ void init_zero_copy_receive(){


void e1000_interrupt_handler(){
//calls the corresponding interrupt handlers.
int reg = e1000[E1000_ICR];
if (reg & E1000_ICR_RXT0){
e1000_rec_handler();
Expand Down
42 changes: 42 additions & 0 deletions net/testoutput.c~
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include "ns.h"

#ifndef TESTOUTPUT_COUNT
#define TESTOUTPUT_COUNT 1000
#endif

static envid_t output_envid;

static struct jif_pkt *pkt = (struct jif_pkt*)REQVA;


void
umain(int argc, char **argv)
{
envid_t ns_envid = sys_getenvid();
int i, r;

binaryname = "testoutput";

output_envid = fork();
if (output_envid < 0)
panic("error forking");
else if (output_envid == 0) {
output(ns_envid);
return;
}

for (i = 0; i < TESTOUTPUT_COUNT; i++) {
if ((r = sys_page_alloc(0, pkt, PTE_P|PTE_U|PTE_W)) < 0)
panic("sys_page_alloc: %e", r);
pkt->jp_len = snprintf(pkt->jp_data,
PGSIZE - sizeof(pkt->jp_len),
"Packet %02d", i);
cprintf("Transmitting packet %d\n", i);
ipc_send(output_envid, NSREQ_OUTPUT, pkt, PTE_P|PTE_W|PTE_U);
sys_page_unmap(0, pkt);
}

// Spin for a while, just in case IPC's or packets need to be flushed
for (i = 0; i < TESTOUTPUT_COUNT*2; i++)
sys_yield();
}

0 comments on commit a1abc80

Please sign in to comment.