Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
3341e30f
Commit
3341e30f
authored
17 years ago
by
rsc
Browse files
Options
Downloads
Patches
Plain Diff
nit
parent
a759b8a4
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
cat.c
+3
-3
3 additions, 3 deletions
cat.c
fcntl.h
+1
-1
1 addition, 1 deletion
fcntl.h
fs.c
+3
-3
3 additions, 3 deletions
fs.c
main.c
+4
-6
4 additions, 6 deletions
main.c
with
11 additions
and
13 deletions
cat.c
+
3
−
3
View file @
3341e30f
...
...
@@ -5,7 +5,7 @@
char
buf
[
512
];
void
rfile
(
int
fd
)
cat
(
int
fd
)
{
int
n
;
...
...
@@ -23,7 +23,7 @@ main(int argc, char *argv[])
int
fd
,
i
;
if
(
argc
<=
1
)
{
rfile
(
0
);
cat
(
0
);
exit
();
}
...
...
@@ -32,7 +32,7 @@ main(int argc, char *argv[])
printf
(
1
,
"cat: cannot open %s
\n
"
,
argv
[
i
]);
exit
();
}
rfile
(
fd
);
cat
(
fd
);
close
(
fd
);
}
exit
();
...
...
This diff is collapsed.
Click to expand it.
fcntl.h
+
1
−
1
View file @
3341e30f
#define O_CREATE 0x200
#define O_RDONLY 0x000
#define O_WRONLY 0x001
#define O_RDWR 0x002
#define O_CREATE 0x200
This diff is collapsed.
Click to expand it.
fs.c
+
3
−
3
View file @
3341e30f
...
...
@@ -205,7 +205,7 @@ ilock(struct inode *ip)
if
(
!
(
ip
->
flags
&
I_VALID
)){
bp
=
bread
(
ip
->
dev
,
IBLOCK
(
ip
->
inum
));
dip
=
&
(
(
struct
dinode
*
)
(
bp
->
data
))[
ip
->
inum
%
IPB
]
;
dip
=
(
struct
dinode
*
)
bp
->
data
+
ip
->
inum
%
IPB
;
ip
->
type
=
dip
->
type
;
ip
->
major
=
dip
->
major
;
ip
->
minor
=
dip
->
minor
;
...
...
@@ -275,7 +275,7 @@ ialloc(uint dev, short type)
readsb
(
dev
,
&
sb
);
for
(
inum
=
1
;
inum
<
sb
.
ninodes
;
inum
++
)
{
// loop over inode blocks
bp
=
bread
(
dev
,
IBLOCK
(
inum
));
dip
=
(
struct
dinode
*
)
(
bp
->
data
)
+
inum
%
IPB
;
dip
=
(
struct
dinode
*
)
bp
->
data
+
inum
%
IPB
;
if
(
dip
->
type
==
0
)
{
// a free inode
memset
(
dip
,
0
,
sizeof
(
*
dip
));
dip
->
type
=
type
;
...
...
@@ -296,7 +296,7 @@ iupdate(struct inode *ip)
struct
dinode
*
dip
;
bp
=
bread
(
ip
->
dev
,
IBLOCK
(
ip
->
inum
));
dip
=
(
struct
dinode
*
)
(
bp
->
data
)
+
ip
->
inum
%
IPB
;
dip
=
(
struct
dinode
*
)
bp
->
data
+
ip
->
inum
%
IPB
;
dip
->
type
=
ip
->
type
;
dip
->
major
=
ip
->
major
;
dip
->
minor
=
ip
->
minor
;
...
...
This diff is collapsed.
Click to expand it.
main.c
+
4
−
6
View file @
3341e30f
...
...
@@ -5,9 +5,7 @@
#include
"proc.h"
#include
"x86.h"
extern
char
edata
[],
end
[];
void
bootothers
(
void
);
static
void
bootothers
(
void
);
// Bootstrap processor starts running C code here.
int
...
...
@@ -15,6 +13,7 @@ main(void)
{
int
i
;
static
volatile
int
bcpu
;
// cannot be on stack
extern
char
edata
[],
end
[];
// clear BSS
memset
(
edata
,
0
,
end
-
edata
);
...
...
@@ -65,7 +64,6 @@ mpmain(void)
idtinit
();
lapic_init
(
cpu
());
setupsegs
(
0
);
cpuid
(
0
,
0
,
0
,
0
,
0
);
// memory barrier
cpus
[
cpu
()].
booted
=
1
;
...
...
@@ -76,7 +74,7 @@ mpmain(void)
scheduler
();
}
void
static
void
bootothers
(
void
)
{
extern
uchar
_binary_bootother_start
[],
_binary_bootother_size
[];
...
...
@@ -91,7 +89,7 @@ bootothers(void)
if
(
c
==
cpus
+
cpu
())
// We've started already.
continue
;
//
Set target
%esp, %eip
//
Fill in
%esp, %eip
and start code on cpu.
*
(
void
**
)(
code
-
4
)
=
c
->
mpstack
+
MPSTACK
;
*
(
void
**
)(
code
-
8
)
=
mpmain
;
lapic_startap
(
c
->
apicid
,
(
uint
)
code
);
...
...
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