Safety requirements of `Port::read` and `Port::write`

Aperta
#629 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
embedded-iot

Direzione di ricerca

Start by reading the safety documentation for Port::read and Port::write and the Port implementation in the x86_64 crate; the issue does not name specific files or tests. Identify the safety preconditions, including whether multiple ports with the same ID are valid, and document them. Done means the unsafe methods’ docs give an exhaustive, actionable account of their safety requirements.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Context: I'm working on a Rust os dev course based on https://os.phil-opp.com (which is a great educational resource, thank you!) and I want to restrict students from writing unsafe code. I want to provide all necessary unsafe code in my template and have a safe wrapper around them so that students can use it.

For writing a safe wrapper around Port, I need to know the safety requirements of its unsafe methods. I can think of trivial ones like creating a Port with invalid port id, but it is unclear to me e.g. whether creating two port with same id will lead to UB or not. So an exhaustive list of safety precondition for those functions is much appreciated. Current docs "This function is unsafe because the I/O port could have side effects that violate memory safety." is not really helpful. Thanks!

Lingua principale
Rust
Stelle
946
Fork
161
Merge medio
1g 21h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-osdev/x86_64

Tutte le issue di rust-osdev/x86_64

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.