Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
030a4773
Commit
030a4773
authored
15 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
tab police
parent
21573833
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
kill.c
+1
-1
1 addition, 1 deletion
kill.c
lapic.c
+1
-1
1 addition, 1 deletion
lapic.c
proc.h
+1
-1
1 addition, 1 deletion
proc.h
uart.c
+39
-39
39 additions, 39 deletions
uart.c
with
42 additions
and
42 deletions
kill.c
+
1
−
1
View file @
030a4773
...
...
@@ -6,7 +6,7 @@ int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
if
(
argc
<
1
){
printf
(
2
,
"usage: kill pid...
\n
"
);
exit
();
...
...
This diff is collapsed.
Click to expand it.
lapic.c
+
1
−
1
View file @
030a4773
...
...
@@ -156,7 +156,7 @@ lapicstartap(uchar apicid, uint addr)
lapicw
(
ICRLO
,
INIT
|
LEVEL
|
ASSERT
);
microdelay
(
200
);
lapicw
(
ICRLO
,
INIT
|
LEVEL
);
microdelay
(
100
);
// should be 10ms, but too slow in Bochs!
microdelay
(
100
);
// should be 10ms, but too slow in Bochs!
// Send startup IPI (twice!) to enter bootstrap code.
// Regular hardware is supposed to only accept a STARTUP
...
...
This diff is collapsed.
Click to expand it.
proc.h
+
1
−
1
View file @
030a4773
...
...
@@ -32,7 +32,7 @@ struct proc {
uint
sz
;
// Size of process memory (bytes)
char
*
kstack
;
// Bottom of kernel stack for this process
enum
proc_state
state
;
// Process state
int
pid
;
// Process ID
volatile
int
pid
;
// Process ID
struct
proc
*
parent
;
// Parent process
struct
trapframe
*
tf
;
// Trap frame for current syscall
struct
context
*
context
;
// Switch here to run process
...
...
This diff is collapsed.
Click to expand it.
uart.c
+
39
−
39
View file @
030a4773
...
...
@@ -10,67 +10,67 @@
#include
"proc.h"
#include
"x86.h"
#define COM1
0x3f8
#define COM1
0x3f8
static
int
uart
;
// is there a uart?
static
int
uart
;
// is there a uart?
void
uartinit
(
void
)
{
char
*
p
;
char
*
p
;
// Turn off the FIFO
outb
(
COM1
+
2
,
0
);
// 9600 baud, 8 data bits, 1 stop bit, parity off.
outb
(
COM1
+
3
,
0x80
);
// Unlock divisor
outb
(
COM1
+
0
,
115200
/
9600
);
outb
(
COM1
+
1
,
0
);
outb
(
COM1
+
3
,
0x03
);
// Lock divisor, 8 data bits.
outb
(
COM1
+
4
,
0
);
outb
(
COM1
+
1
,
0x01
);
// Enable receive interrupts.
// Turn off the FIFO
outb
(
COM1
+
2
,
0
);
// 9600 baud, 8 data bits, 1 stop bit, parity off.
outb
(
COM1
+
3
,
0x80
);
// Unlock divisor
outb
(
COM1
+
0
,
115200
/
9600
);
outb
(
COM1
+
1
,
0
);
outb
(
COM1
+
3
,
0x03
);
// Lock divisor, 8 data bits.
outb
(
COM1
+
4
,
0
);
outb
(
COM1
+
1
,
0x01
);
// Enable receive interrupts.
// If status is 0xFF, no serial port.
if
(
inb
(
COM1
+
5
)
==
0xFF
)
return
;
uart
=
1
;
// If status is 0xFF, no serial port.
if
(
inb
(
COM1
+
5
)
==
0xFF
)
return
;
uart
=
1
;
// Acknowledge pre-existing interrupt conditions;
// enable interrupts.
inb
(
COM1
+
2
);
inb
(
COM1
+
0
);
picenable
(
IRQ_COM1
);
ioapicenable
(
IRQ_COM1
,
0
);
// Announce that we're here.
for
(
p
=
"xv6...
\n
"
;
*
p
;
p
++
)
uartputc
(
*
p
);
// Acknowledge pre-existing interrupt conditions;
// enable interrupts.
inb
(
COM1
+
2
);
inb
(
COM1
+
0
);
picenable
(
IRQ_COM1
);
ioapicenable
(
IRQ_COM1
,
0
);
// Announce that we're here.
for
(
p
=
"xv6...
\n
"
;
*
p
;
p
++
)
uartputc
(
*
p
);
}
void
uartputc
(
int
c
)
{
int
i
;
int
i
;
if
(
!
uart
)
return
;
for
(
i
=
0
;
i
<
128
&&
!
(
inb
(
COM1
+
5
)
&
0x20
);
i
++
)
microdelay
(
10
);
outb
(
COM1
+
0
,
c
);
if
(
!
uart
)
return
;
for
(
i
=
0
;
i
<
128
&&
!
(
inb
(
COM1
+
5
)
&
0x20
);
i
++
)
microdelay
(
10
);
outb
(
COM1
+
0
,
c
);
}
static
int
uartgetc
(
void
)
{
if
(
!
uart
)
return
-
1
;
if
(
!
(
inb
(
COM1
+
5
)
&
0x01
))
return
-
1
;
return
inb
(
COM1
+
0
);
if
(
!
uart
)
return
-
1
;
if
(
!
(
inb
(
COM1
+
5
)
&
0x01
))
return
-
1
;
return
inb
(
COM1
+
0
);
}
void
uartintr
(
void
)
{
consoleintr
(
uartgetc
);
consoleintr
(
uartgetc
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment