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
cb83c716
Commit
cb83c716
authored
18 years ago
by
rtm
Browse files
Options
Downloads
Patches
Plain Diff
fix some trap bugs
parent
84eb544b
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
Notes
+6
-0
6 additions, 0 deletions
Notes
main.c
+10
-2
10 additions, 2 deletions
main.c
trap.c
+9
-3
9 additions, 3 deletions
trap.c
vectors.pl
+1
-1
1 addition, 1 deletion
vectors.pl
with
26 additions
and
6 deletions
Notes
+
6
−
0
View file @
cb83c716
...
...
@@ -73,3 +73,9 @@ setupsegs() may modify current segment table, is that legal?
trap() ought to lgdt on return, since currently only done in swtch()
protect hardware interrupt vectors from user INT instructions?
i'm getting a curious interrupt when jumping into user space. maybe
it's IRQ 0, but it comes at a weird and changing vector (e.g. 119) if
you don't initialize the PIC. why doesn't jos see this? if i
initialize the PIC with IRQ_OFFSET 32, the interrupt arrives at vector
32.
This diff is collapsed.
Click to expand it.
main.c
+
10
−
2
View file @
cb83c716
...
...
@@ -5,12 +5,20 @@
#include
"defs.h"
#include
"x86.h"
char
junk1
[
20000
];
char
junk2
[
20000
]
=
{
1
};
extern
char
edata
[],
end
[];
main
()
{
struct
proc
*
p
;
// clear BSS
memset
(
edata
,
0
,
end
-
edata
);
// partially initizialize PIC
outb
(
0x20
+
1
,
0xFF
);
// IO_PIC1
outb
(
0xA0
+
1
,
0xFF
);
// IO_PIC2
outb
(
0x20
,
0x11
);
outb
(
0x20
+
1
,
32
);
cprintf
(
"
\n
xV6
\n\n
"
);
...
...
This diff is collapsed.
Click to expand it.
trap.c
+
9
−
3
View file @
cb83c716
...
...
@@ -12,11 +12,15 @@ extern unsigned vectors[]; /* vectors.S, array of 256 entry point addresses */
extern
void
trapenter
();
extern
void
trapenter1
();
int
xx
;
void
tinit
()
{
int
i
;
xx
=
0
;
for
(
i
=
0
;
i
<
256
;
i
++
){
SETGATE
(
idt
[
i
],
1
,
SEG_KCODE
<<
3
,
vectors
[
i
],
3
);
}
...
...
@@ -27,8 +31,10 @@ void
trap
(
struct
Trapframe
*
tf
)
{
/* which process are we running? */
cprintf
(
"trap %d tf %x
\n
"
,
tf
->
tf_trapno
,
tf
);
while
(
1
)
;
if
(
xx
<
10
)
cprintf
(
"%d
\n
"
,
tf
->
tf_trapno
);
xx
++
;
//while(1)
//;
// XXX probably ought to lgdt on trap return
}
This diff is collapsed.
Click to expand it.
vectors.pl
+
1
−
1
View file @
cb83c716
...
...
@@ -14,7 +14,7 @@ for(my $i = 0; $i < 256; $i++){
if
((
$i
<
8
||
$i
>
14
)
&&
$i
!=
17
){
print
"
\t
pushl
\$
0
\n
";
}
print
"
\t
pushl
$i
\n
";
print
"
\t
pushl
\$
$i
\n
";
print
"
\t
jmp alltraps
\n
";
}
print
"
.data
\n
";
...
...
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