The writ of habeas corpus shall be issued, served, and tried in the manner prescribed in this chapter.