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
5e533d7d
Commit
5e533d7d
authored
4 years ago
by
Thierno souleymane Bah
Browse files
Options
Downloads
Patches
Plain Diff
feat(write sector prog implemented)
parent
34881d68
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
tpfs/Makefile
+2
-1
2 additions, 1 deletion
tpfs/Makefile
tpfs/display_sector.c
+0
-3
0 additions, 3 deletions
tpfs/display_sector.c
tpfs/write_sector.c
+54
-0
54 additions, 0 deletions
tpfs/write_sector.c
with
56 additions
and
4 deletions
tpfs/Makefile
+
2
−
1
View file @
5e533d7d
...
...
@@ -13,7 +13,7 @@ LIBS = -L$(LIBDIR) -lhardware
###------------------------------
### Main targets
###------------------------------------------------------------
BINARIES
=
mkhd display_sector format_sector
BINARIES
=
mkhd display_sector format_sector
write_sector
all
:
$(BINARIES) $(OBJECTS)
...
...
@@ -30,6 +30,7 @@ all: $(BINARIES) $(OBJECTS)
mkhd
:
mkhd.o
display_sector
:
display_sector.o drive.o
format_sector
:
format_sector.o drive.o
write_sector
:
write_sector.o drive.o
###------------------------------
### Misc.
...
...
This diff is collapsed.
Click to expand it.
tpfs/display_sector.c
+
0
−
3
View file @
5e533d7d
...
...
@@ -4,9 +4,6 @@
#include
"hardware.h"
#include
"drive.h"
/* Paramètres de la simulation */
#define HDA_FILENAME "vdiskA.bin"
/* nom du fichier de stockage du disque simulé */
static
void
empty_it
()
{
...
...
This diff is collapsed.
Click to expand it.
tpfs/write_sector.c
0 → 100644
+
54
−
0
View file @
5e533d7d
#include
<stdio.h>
#include
<stdlib.h>
#include
"hardware.h"
#include
"drive.h"
static
void
empty_it
()
{
return
;
}
void
write_sector
(
int
cylinder
,
int
sector
,
unsigned
char
*
buf
)
{
int
i
;
seek
(
cylinder
,
sector
);
for
(
i
=
0
;
i
<
HDA_SECTORSIZE
;
i
++
)
MASTERBUFFER
[
i
]
=
buf
[
i
];
_out
(
HDA_DATAREGS
,
0
);
_out
(
HDA_DATAREGS
+
1
,
1
);
_out
(
HDA_CMDREG
,
CMD_WRITE
);
_sleep
(
HDA_IRQ
);
}
int
main
(
int
argc
,
char
const
*
argv
[])
{
unsigned
int
i
;
if
(
argc
!=
4
)
{
fprintf
(
stderr
,
"Usage: %s <cylinder> <sector> <data>
\n
"
,
argv
[
0
]);
exit
(
EXIT_FAILURE
);
}
/* init hardware */
if
(
init_hardware
(
"hwconfig.ini"
)
==
0
)
{
fprintf
(
stderr
,
"Error in hardware initialization
\n
"
);
exit
(
EXIT_FAILURE
);
}
/* Interreupt handlers */
for
(
i
=
0
;
i
<
16
;
i
++
)
IRQVECTOR
[
i
]
=
empty_it
;
/* Allows all IT */
_mask
(
1
);
write_sector
(
atoi
(
argv
[
1
]),
atoi
(
argv
[
2
]),
(
unsigned
char
*
)
argv
[
3
]);
/* and exit! */
exit
(
EXIT_SUCCESS
);
}
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