GROS IS A ROUTING OPERATING SYSTEM

Download Report

Transcript GROS IS A ROUTING OPERATING SYSTEM

GROS
(GROS IS A ROUTING OPERATING SYSTEM)
Phase II
Batch : 6
Guide :Sabitha . S
Hemant Pillai
Dean John Abraham
Krishnakumar.R
An Overview
• Review of previous stage.
• Fast Ethernet card reception and
transmission.
• Transfer of packets from one network to
another.
• Equalizing the priority of cards.
• Bug yet to be solved
Review of previous stage
• Booting.
• Protected mode switching.
• Reception and transmission of packets
using PCI and ISA cards.
Preliminaries
• Speed of network cards
Ordinary – 10Mbps
Fast - 100Mbps
Gigabit Ethernets – 1000Mbps
• We use Fast Ethernet cards , 100Mbps
• Hubs are of 10Mbps
• So Uses Auto-negotiation
Auto-Negotiation
• Checks the ability of the partner.
• Selects the common, maximum possible
speed.
• Done by the transceiver on the card.
• In our case it is REALTEK’s 8139
chipset .
Fast Ethernet cards
• GROS function pci_bios gets us the
base address of the card.
• Situation demands two cards
• Had to search Bus no 0 and 1 to find the
address of both n/w cards
• Hardware address can be got as in case of
Ordinary cards (Read from PROM).
• Done when initializing the card.
• Transmission different
Environment
• Two networks
• Can be heterogeneous networks with
different OS’es running over IP.
• A single machine with GROS, connected
to two networks
• The machine has two Fast Ethernet
cards.
The Plan
network2
network1
check
Case 1 : Packet
Case 2 : Packet
from networ1 to
from network 2
network2
to network 1
System with
GROS
The Network card class ne
• ne , Object used for network card
management.
• Presently it has only one method, init.
• Declared In file ne.h.
• Next slides, code is being explained
. . . . represents few lines of code
The code for ne
class ne {
public:
unsigned int *rx_ring;
void init(int notFirInit,
int ioAd);
}
Highlights of ne
• rx_ring - is the reception ring.
• void ne::init(int notFirInit,
int ioAd){
..........
if (!notFirInit) {
/* Get hw address*/
/* Print it
*/
. . . . . . .
}
/* Bring chip to low power mode */
outb(0xC0, ioAd + CFG9346);
outb(0x03, ioAd + CONFIG1);
outb('H‘, ioAd + HLTCLK);
/* Reset the chip */
outb(CMDRESET, ioAd + CHIPCMD);
for (i = 1000 ; i > 0 ; i-- )
if ((inb(ioAd + CHIPCMD) &
CMDRESET) == 0)
break;
. . . Fixup up the Max DMA . . .
. . . Burst and duplex mode . . .
outl((unsigned long)rx_ring, ioAd +
RXBUF);
. .
Put the card to promiscous mode . .
. .
. .
Enable the transmission . . .
Enable interrupts
. . .
}
• Using this class
we declare : ne *n=(ne *) 0x5000;
• Receive ring is initialized in the fn.
‘newmain’ as
n->rx_ring=(unsigned int*)0x8000
• n->init(0, ioAd1)
• n->init(0, ioAd2)
(ioAd1 and ioAd2 got by function pci_bios )
Interrupts
• enable_irq()function enables the irq’s of
keyboard and the two n/w cards.
• Two function are registered :
net1() as ISR of n/w card 1
net2() as ISR of n/w card 2
• Both functions call common function :
net(addr1,addr2)
net1 calls with ioAd1 and ioAd2
net2 with ioAd2 and ioAd1 as parameters
Reception
• Both the card receives to n->rx_ring one at a
time.
• After a single reception :
n->rx_ring
status
1
1
next
2
size
Size = header + pckt length
rest of pckt
High lights of Transmission
•
Put the address of packet to be transmitted
to Transmit address register
outl((unsigned int)(n->rx_ring+4),
,ioAd2+TXADDR0);
•
Tell the network card to transmit it
outl(0xffffdfff & (myflag|
((unsigned int)hdr.h.count-4))
,ioAd2+TXSTATUS0);
The difference
•
•
•
•
•
Usual drivers use upto 4 xmit buffers
When transmit success, interrupt raised
Buffer marked as free
Here only one buffer used.
Wait until a single packet is transmitted
while(!(inl(ioAd2+TXSTATUS0)&0x00008000))
{
times++;
if (times == 100) break;
}
The Bug
•
•
•
Traffic of one side greater then always the card
of that side gets serviced(if it has low irq no.)
The trouble is with 8259 Interrupt controller
After an interrupt is serviced, its priority is
made lowest . Hence all equal
/* The code below equilizes the */
/* priority of all IRQ's D7=R=1 */
/* and D5=S=1
*/
outb(0xa0,0x20);
outb(0xa0,0xa0);
Checking
•
Transmitted packets from machine in one n/w
to a machine in other n/w
•
In the other n/w we checked using TCPDUMP
•
PING, TELNET and other tools does work
•
Tried changing the ip address when the packet
was within GROS. Succeded
Bug yet to be solved
•
•
•
•
GROS crashes when no of packets reach 2400
range
First Observed when :
- LINUX NFS client m/c on one n/w
- Server on another n/w
- Ran X windows
- Desktop was being transmitted crashed.
Verified packet nos by using the broadcast
option of PING and TCPDUMP.
Changed stack location without success.
Summary
•
Fast Ethernet card Functionality
•
Getting packet from one n/w to another
•
IRQ priority problem
•
Checking
•
The remaining Bug
Thank You