Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ASA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASE-2021
ASA
Commits
e524e4b8
Commit
e524e4b8
authored
4 years ago
by
Thierno souleymane Bah
Browse files
Options
Downloads
Patches
Plain Diff
feat(format vol function done)
parent
ac581563
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tpfs/vol.c
+12
-0
12 additions, 0 deletions
tpfs/vol.c
tpfs/vol.h
+2
-0
2 additions, 0 deletions
tpfs/vol.h
with
14 additions
and
0 deletions
tpfs/vol.c
+
12
−
0
View file @
e524e4b8
...
...
@@ -72,3 +72,15 @@ void write_bloc(unsigned int vol, unsigned int nbloc, const unsigned char *buffe
int
sector_cylinder
[
2
]
=
get_sector_cylinder
(
vol
,
nbloc
);
// [sector, cylinder]
write_sector
(
sector_cylinder
[
1
],
sector_cylinder
[
0
],
buffer
);
}
void
format_vol
(
unsigned
int
vol
)
{
int
nbloc
;
vol_t
current_vol
=
mbr
.
vols
[
vol
];
for
(
nbloc
=
0
;
nbloc
<
current_vol
.
nb_sectors
;
nbloc
++
)
{
int
sector_cylinder
[
2
]
=
get_sector_cylinder
(
vol
,
nbloc
);
format_sector
(
sector_cylinder
[
1
],
sector_cylinder
[
1
],
FMT_SIZE
,
FMT_DATA
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
tpfs/vol.h
+
2
−
0
View file @
e524e4b8
...
...
@@ -3,6 +3,8 @@
#define VOLS_MAX 8
#define MBR_MAGIC 0xCAFE // Savoir si le mbr a déjà été initialisé ou non
#define FMT_DATA 0xCAFEBABE
#define FMT_SIZE 0x1
static
mbr_t
mbr
;
...
...
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