Nettoyage

This commit is contained in:
Adrien Bourmault 2023-10-12 01:00:39 +02:00
parent 2778dc91fa
commit ea656d61b3
No known key found for this signature in database
GPG Key ID: 2974E1D5F25DFCC8
30 changed files with 19 additions and 1527 deletions

View File

@ -72,7 +72,7 @@ void main_multiboot2(void *mb2)
fake.pgt = store_cr3();
new = alloc_page();
map_page(&fake, 0xFF5504000, new);
map_page(&fake, 0xFFFFFFFFFFF, new);
printk("-----------\n\n");

View File

@ -104,41 +104,35 @@ void free_page(paddr_t addr)
void map_page(struct task *ctx, vaddr_t vaddr, paddr_t paddr)
{
uint64_t *cur_pml = ctx->pgt;
uint64_t cur_entry = 0;
uint64_t *next_addr = NULL;
uint64_t *cur_pml = (uint64_t *)ctx->pgt;
int n = 4;
printk("[map_page] trying to map 0x%lx -> 0x%lx\n",
vaddr, paddr);
// Exploring each level to the ground
while(n > 1) {
printk("\tEntering PML%d @ 0x%lx\n",
n,
&cur_pml[0]);
while(n > 1) {
// Checking entry validity if level n > 1
// Also checking if ADDR != 0
if (cur_pml[PGT_PML_INDEX(n, vaddr)] & PGT_VALID_MASK
&& cur_pml[PGT_PML_INDEX(n, vaddr)] & PGT_ADDR_MASK) {
printk("\t\tPML%d entry 0x%lx @ 0x%lx is valid (=0x%lx)\n",
n,
cur_pml[PGT_PML_INDEX(n, vaddr)],
&cur_pml[PGT_PML_INDEX(n, vaddr)],
cur_pml[PGT_PML_INDEX(n, vaddr)]
& PGT_VALID_MASK);
/* printk("[map_page] PML%d entry 0x%lx @ 0x%lx is valid (=0x%lx)\n", */
/* n, */
/* cur_pml[PGT_PML_INDEX(n, vaddr)], */
/* &cur_pml[PGT_PML_INDEX(n, vaddr)], */
/* cur_pml[PGT_PML_INDEX(n, vaddr)] */
/* & PGT_VALID_MASK); */
} else {
printk("\t\tPML%d entry 0x%lx @ 0x%lx is NOT valid (=0x%lx)\n",
n,
cur_pml[PGT_PML_INDEX(n, vaddr)],
&cur_pml[PGT_PML_INDEX(n, vaddr)],
cur_pml[PGT_PML_INDEX(n, vaddr)]
& PGT_VALID_MASK);
/* printk("[map_page] PML%d entry 0x%lx @ 0x%lx is NOT valid (=0x%lx)\n", */
/* n, */
/* cur_pml[PGT_PML_INDEX(n, vaddr)], */
/* &cur_pml[PGT_PML_INDEX(n, vaddr)], */
/* cur_pml[PGT_PML_INDEX(n, vaddr)] */
/* & PGT_VALID_MASK); */
cur_pml[PGT_PML_INDEX(n, vaddr)] = alloc_page();
printk("\t\t\tAllocated at 0x%lx\n",
printk("[map_page] Allocated page at 0x%lx\n",
cur_pml[PGT_PML_INDEX(n, vaddr)]);
cur_pml[PGT_PML_INDEX(n, vaddr)] |= PGT_VALID_MASK
@ -146,18 +140,14 @@ void map_page(struct task *ctx, vaddr_t vaddr, paddr_t paddr)
| PGT_USER_MASK;
}
// Computing the next PML_n entry
cur_pml = cur_pml[PGT_PML_INDEX(n, vaddr)] & PGT_ADDR_MASK;
cur_pml = (uint64_t *)(cur_pml[PGT_PML_INDEX(n, vaddr)] & PGT_ADDR_MASK);
n--;
}
printk("\tEntering PML%d @ 0x%lx\n",
n,
&cur_pml[0]);
// Mapping, we're n == 1
// Checking validity and addr != 0
if (cur_pml[PGT_PML_INDEX(n, vaddr)] & PGT_VALID_MASK) {
printk("\t\tvaddr 0x%lx WAS ALREADY mapped to 0x%lx !!!\n",
printk("[map_page] vaddr 0x%lx WAS ALREADY mapped to 0x%lx !!!\n",
vaddr,
cur_pml[PGT_PML_INDEX(n, vaddr)]
& PGT_ADDR_MASK);
@ -167,7 +157,7 @@ void map_page(struct task *ctx, vaddr_t vaddr, paddr_t paddr)
| PGT_WRITABLE_MASK
| PGT_USER_MASK;
printk("\t\tvaddr 0x%lx mapped to 0x%lx\n",
printk("[map_page] vaddr 0x%lx mapped to 0x%lx\n",
vaddr,
cur_pml[PGT_PML_INDEX(n, vaddr)]
& PGT_ADDR_MASK);

View File

@ -1,10 +0,0 @@
set timeout=0
set default=0
menuentry 'Rackdoll' {
echo 'Loading Rackdoll OS'
multiboot2 /boot/rackdoll.elf
module2 /boot/hash.elf
module2 /boot/sieve.elf
module2 /boot/adversary.elf
}

View File

@ -1,2 +0,0 @@
\newacronym{Insee}{Insee}{Institut national de la statistique et des études économiques}
\newacronym{Tracfin}{Tracfin}{Traitement du renseignement et action contre les circuits financiers clandestins}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -1,42 +0,0 @@
% -*- coding: utf-8 -*-
% Preamble
\documentclass[french, 12pt]{report}
\usepackage[utf8]{inputenc}
\usepackage{url}
\usepackage{float}
\usepackage{fontspec}
\usepackage{hyperref}
\usepackage{setspace}
\usepackage[style=numeric]{biblatex}
\usepackage{tocloft}
\usepackage{titlesec}
\usepackage[T1]{fontenc}
\usepackage[french]{babel}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{xcolor}
\usepackage[a4paper, portrait, margin=1.45cm]{geometry}
\title{Titre du mémoire}
\author{Nom et prénom de l'auteur}
\date{\today}
% Set parameters
\setcounter{page}{0}
\hypersetup{linktoc=all}
\addtolength{\skip\footins}{0.6pc}
\renewcommand*\footnoterule{} %Footnode separator line
\def\siecle#1{\textsc{\romannumeral #1}\textsuperscript{e}~siècle}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}} %places dots on sections lines as well
\cftsetindents{section}{0pt}{4em}
\cftsetindents{subsection}{10pt}{4em}
\cftsetindents{subsubsection}{20pt}{4em}
\cftsetindents{paragraph}{30pt}{4em}
\cftsetindents{subparagraph}{40pt}{4em}
\def\cftdotsep{1}
\cftsetpnumwidth{1em}
\renewcommand{\cftchapafterpnum}{\vspace{\cftbeforechapskip}}

Binary file not shown.

View File

@ -1,84 +0,0 @@
\input{packages.tex}
\newcounter{mypara}
\setcounter{mypara}{0}
\setcounter{secnumdepth}{4}
%Bibliography
\addbibresource{bibliographie.bib}
% Document
\begin{document}{
\sloppy
\input{titlepage.tex}
\setcounter{tocdepth}{4}
\setcounter{secnumdepth}{4}
% Table of contents
\tableofcontents
\newpage
% First chapter
\chapter{Introduction}
Blablabla
\begin{figure}[h!]
\center
\includegraphics{images/su.png}
\caption{Petite image}
\label{fig:schema1}
\end{figure}
\setstretch{1}
\section{Une section}
\setstretch{1.3}
Blabla \newline
Blablabla.
\setstretch{1}
\subsection{Une sous-section}
\setstretch{1.3}
Bla à propos de l'\textbf{bla important} dont le fonctionnement est schématisé dans la figure \ref{fig:schema1}.
% Second chapter
\chapter{Seconde chose à dire}
A ce propos \textit{italique}.
\begin{figure}[h!]
\center
\includegraphics[width=\linewidth]{images/su.png}
\caption{Image pleine page}
\label{fig:image_pleine}
\end{figure}
\setstretch{1}
\section{Une section}
\setstretch{1.3}
Texte pour dire tout ça parceque oui. \newline
Ceci ne veut pas dire cependant que :
\begin{itemize}
\item Élément 1
\item Élément 2
\item Élément 3
\end{itemize}
\newpage
% Bibliography
\nocite{*}
\addcontentsline{toc}{chapter}{Bibliographie}
\printbibliography
\end{document}

View File

@ -1,41 +0,0 @@
% Titlepage
\begin{titlepage}
\begin{center}
\scalebox{1}{\includegraphics{images/su.png}}
\end{center}
\vspace{0.5 cm}
\begin{center}
Faculté des Sciences et Ingénierie\\
Master Informatique\\
Systèmes Électroniques, Systèmes Informatiques
\end{center}
\vspace{3.0 cm}
\begin{center}
\Huge{{Template}}
\end{center}
\vspace{0.1 cm}
\begin{center}
\Large{Sous-titre du template}
\end{center}
\vspace{8.5 cm}
\begin{center}
\normalsize{Adrien Bourmault\\(\href{mailto:adrien.bourmault@etu.upmc.fr}{adrien.bourmault@etu.upmc.fr})}
\end{center}
\begin{center}
\normalsize{Enseignant : NOM PROF}
\end{center}
\vspace{1.0 cm}
\end{titlepage}