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
411ee741
Commit
411ee741
authored
17 years ago
by
rtm
Browse files
Options
Downloads
Patches
Plain Diff
fix comments
parent
e9f8419f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bootasm.S
+1
-1
1 addition, 1 deletion
bootasm.S
bootmain.c
+5
-7
5 additions, 7 deletions
bootmain.c
mkfs.c
+2
-2
2 additions, 2 deletions
mkfs.c
with
8 additions
and
10 deletions
bootasm.S
+
1
−
1
View file @
411ee741
...
...
@@ -44,7 +44,7 @@ seta20.2:
//
PAGEBREAK
!
#
Switch
from
real
to
protected
mode
,
using
a
bootstrap
GDT
#
and
segment
translation
that
makes
virtual
addresses
#
identical
to
their
physical
addresses
,
so
that
the
#
identical
to
physical
addresses
,
so
that
the
#
effective
memory
map
does
not
change
during
the
switch
.
lgdt
gdtdesc
movl
%
cr0
,
%
eax
...
...
This diff is collapsed.
Click to expand it.
bootmain.c
+
5
−
7
View file @
411ee741
// Boot loader.
//
// The BIOS loads boot sector (bootasm.S) from sector 0 of the disk
// into memory and executes it. The boot sector puts the processor
// in 32-bit mode and calls bootmain below, which loads an ELF kernel
// image from the disk starting at sector 1 and then jumps to the
// kernel entry routine.
// Part of the boot sector, along with bootasm.S, which calls bootmain().
// bootasm.S has put the processor into protected 32-bit mode.
// bootmain() loads an ELF kernel image from the disk starting at
// sector 1 and then jumps to the kernel entry routine.
#include
"types.h"
#include
"elf.h"
...
...
@@ -34,7 +33,7 @@ bootmain(void)
ph
=
(
struct
proghdr
*
)((
uchar
*
)
elf
+
elf
->
phoff
);
eph
=
ph
+
elf
->
phnum
;
for
(;
ph
<
eph
;
ph
++
)
readseg
(
ph
->
va
,
ph
->
memsz
,
ph
->
offset
);
readseg
(
ph
->
va
&
0xFFFFFF
,
ph
->
memsz
,
ph
->
offset
);
// Call the entry point from the ELF header.
// Does not return!
...
...
@@ -81,7 +80,6 @@ readseg(uint va, uint count, uint offset)
{
uint
eva
;
va
&=
0xFFFFFF
;
eva
=
va
+
count
;
// Round down to sector boundary.
...
...
This diff is collapsed.
Click to expand it.
mkfs.c
+
2
−
2
View file @
411ee741
...
...
@@ -81,7 +81,7 @@ main(int argc, char *argv[])
usedblocks
=
ninodes
/
IPB
+
3
+
bitblocks
;
freeblock
=
usedblocks
;
printf
(
"used %d (bit %d ninode %
d
) free %
d
total %d
\n
"
,
usedblocks
,
printf
(
"used %d (bit %d ninode %
lu
) free %
u
total %d
\n
"
,
usedblocks
,
bitblocks
,
ninodes
/
IPB
+
1
,
freeblock
,
nblocks
+
usedblocks
);
assert
(
nblocks
+
usedblocks
==
size
);
...
...
@@ -229,7 +229,7 @@ balloc(int used)
for
(
i
=
0
;
i
<
used
;
i
++
)
{
buf
[
i
/
8
]
=
buf
[
i
/
8
]
|
(
0x1
<<
(
i
%
8
));
}
printf
(
"balloc: write bitmap block at sector %
d
\n
"
,
ninodes
/
IPB
+
3
);
printf
(
"balloc: write bitmap block at sector %
lu
\n
"
,
ninodes
/
IPB
+
3
);
wsect
(
ninodes
/
IPB
+
3
,
buf
);
}
...
...
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