The first is that you must file your petition within one year of exhausting your direct appeal. 1. Notice of appeal 2.To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court. These rules govern a petition for a writ of habeas corpus filed. 2 in a United States district court under 28 U.S.C. § 2254 by: 3. A 2254 petition must be filed in the federal district court that has jurisdiction over the county where the conviction occurred. A Writ of Habeas Corpus is a civil proceeding that is available in both State and Federal Court to challenge the legality of imprisonment. Federal prisoners may file two different kinds of motions for post-conviction relief: "Section 2255 motions" and "Section 2241 habeas corpus petitions." Provisions of 28 U. S. C. § 2254(b). Federal habeas corpus is a procedure under which a federal court may review the legality of an individual's incarceration.