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
1dca3afb
Commit
1dca3afb
authored
18 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
remove _ prefixes
parent
05a7bbe0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
console.c
+3
-3
3 additions, 3 deletions
console.c
dev.h
+2
-4
2 additions, 4 deletions
dev.h
fs.c
+9
-9
9 additions, 9 deletions
fs.c
ls.c
+4
-4
4 additions, 4 deletions
ls.c
stat.h
+5
-5
5 additions, 5 deletions
stat.h
with
23 additions
and
25 deletions
console.c
+
3
−
3
View file @
1dca3afb
...
...
@@ -356,7 +356,7 @@ kbd_intr()
c
+=
'a'
-
'A'
;
}
//
xxx hack
//
Ignore unknown keystrokes.
if
(
c
==
0x0
)
{
release
(
&
kbd_lock
);
return
;
...
...
@@ -406,8 +406,8 @@ console_init()
initlock
(
&
console_lock
,
"console"
);
initlock
(
&
kbd_lock
,
"kbd"
);
devsw
[
CONSOLE
].
d_
write
=
console_write
;
devsw
[
CONSOLE
].
d_
read
=
console_read
;
devsw
[
CONSOLE
].
write
=
console_write
;
devsw
[
CONSOLE
].
read
=
console_read
;
irq_setmask_8259A
(
irq_mask_8259A
&
~
(
1
<<
IRQ_KBD
));
ioapic_enable
(
IRQ_KBD
,
0
);
...
...
This diff is collapsed.
Click to expand it.
dev.h
+
2
−
4
View file @
1dca3afb
struct
devsw
{
int
(
*
d_open
)(
char
*
,
int
);
int
(
*
d_read
)(
int
,
char
*
,
int
);
int
(
*
d_write
)(
int
,
char
*
,
int
);
int
(
*
d_close
)(
int
);
int
(
*
read
)(
int
,
char
*
,
int
);
int
(
*
write
)(
int
,
char
*
,
int
);
};
extern
struct
devsw
devsw
[];
...
...
This diff is collapsed.
Click to expand it.
fs.c
+
9
−
9
View file @
1dca3afb
...
...
@@ -326,11 +326,11 @@ iincref(struct inode *ip)
void
stati
(
struct
inode
*
ip
,
struct
stat
*
st
)
{
st
->
st_
dev
=
ip
->
dev
;
st
->
st_
ino
=
ip
->
inum
;
st
->
st_
type
=
ip
->
type
;
st
->
st_
nlink
=
ip
->
nlink
;
st
->
st_
size
=
ip
->
size
;
st
->
dev
=
ip
->
dev
;
st
->
ino
=
ip
->
inum
;
st
->
type
=
ip
->
type
;
st
->
nlink
=
ip
->
nlink
;
st
->
size
=
ip
->
size
;
}
#define min(a, b) ((a) < (b) ? (a) : (b))
...
...
@@ -342,9 +342,9 @@ readi(struct inode *ip, char *dst, uint off, uint n)
struct
buf
*
bp
;
if
(
ip
->
type
==
T_DEV
)
{
if
(
ip
->
major
<
0
||
ip
->
major
>=
NDEV
||
!
devsw
[
ip
->
major
].
d_
read
)
if
(
ip
->
major
<
0
||
ip
->
major
>=
NDEV
||
!
devsw
[
ip
->
major
].
read
)
return
-
1
;
return
devsw
[
ip
->
major
].
d_
read
(
ip
->
minor
,
dst
,
n
);
return
devsw
[
ip
->
major
].
read
(
ip
->
minor
,
dst
,
n
);
}
while
(
n
>
0
&&
off
<
ip
->
size
){
...
...
@@ -400,9 +400,9 @@ int
writei
(
struct
inode
*
ip
,
char
*
addr
,
uint
off
,
uint
n
)
{
if
(
ip
->
type
==
T_DEV
)
{
if
(
ip
->
major
<
0
||
ip
->
major
>=
NDEV
||
!
devsw
[
ip
->
major
].
d_
write
)
if
(
ip
->
major
<
0
||
ip
->
major
>=
NDEV
||
!
devsw
[
ip
->
major
].
write
)
return
-
1
;
return
devsw
[
ip
->
major
].
d_
write
(
ip
->
minor
,
addr
,
n
);
return
devsw
[
ip
->
major
].
write
(
ip
->
minor
,
addr
,
n
);
}
else
if
(
ip
->
type
==
T_FILE
||
ip
->
type
==
T_DIR
)
{
struct
buf
*
bp
;
int
r
=
0
;
...
...
This diff is collapsed.
Click to expand it.
ls.c
+
4
−
4
View file @
1dca3afb
...
...
@@ -50,13 +50,13 @@ main(int argc, char *argv[])
exit
();
}
switch
(
st
.
st_
type
)
{
switch
(
st
.
type
)
{
case
T_FILE
:
pname
(
argv
[
1
]);
printf
(
1
,
"%d %d %d
\n
"
,
st
.
st_
type
,
st
.
st_
ino
,
st
.
st_
size
);
printf
(
1
,
"%d %d %d
\n
"
,
st
.
type
,
st
.
ino
,
st
.
size
);
break
;
case
T_DIR
:
sz
=
st
.
st_
size
;
sz
=
st
.
size
;
for
(
off
=
0
;
off
<
sz
;
off
+=
sizeof
(
struct
dirent
))
{
if
(
read
(
fd
,
&
dirent
,
sizeof
dirent
)
!=
sizeof
dirent
)
{
printf
(
1
,
"ls: read error
\n
"
);
...
...
@@ -69,7 +69,7 @@ main(int argc, char *argv[])
continue
;
}
pname
(
dirent
.
name
);
printf
(
1
,
"%d %d %d
\n
"
,
st
.
st_
type
,
dirent
.
inum
,
st
.
st_
size
);
printf
(
1
,
"%d %d %d
\n
"
,
st
.
type
,
dirent
.
inum
,
st
.
size
);
}
}
break
;
...
...
This diff is collapsed.
Click to expand it.
stat.h
+
5
−
5
View file @
1dca3afb
struct
stat
{
int
st_
dev
;
uint
st_
ino
;
short
st_
type
;
short
st_
nlink
;
uint
st_
size
;
int
dev
;
uint
ino
;
short
type
;
short
nlink
;
uint
size
;
};
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