Jimmie D. Barnes received a presumptive prison sentence following his conviction for manufacture of methamphetamine and possession of drug paraphernalia. His conviction was affirmed in State v. Barnes, Nos. 86,891, 86,892, 86,893, unpublished opinion filed July 12, 2002, rev. denied 274 Kan. 1114 (2002). In December 2004, Barnes moved to correct an illegal sentence based upon the ruling in State v. McAdam, 277 Kan. 136, 83 P.3d 161 (2004). The district court overruled his motion on the grounds that McAdam did not retroactively apply to his case. Barnes appealed this ruling. The district court ultimately was affirmed in State v. Barnes, No. 94,080, unpublished opinion filed October 11, 2005, rev. denied 280 Kan. 985 (2005). But in the meantime, in November 2005, while his appeal was still pending, Barnes filed another motion to correct an illegal sentence, this time challenging the manner in which he had been charged and the trial court’s jury instructions. The district court summarily denied the motion, finding that Barnes was attacking his conviction, not his sentence, and that his challenge to the district court’s ruling on an earlier motion to correct an illegal sentence was currently on appeal. It is this ruling that is now before us on appeal.
The State argues that the district court did not have, and we currently do not have, jurisdiction over this matter since at the time the motion was filed and considered there was pending on appeal *138an earlier attack on Barnes’ sentence. We must address this threshold issue first.
Our jurisdiction is defined by law. We must dismiss an appeal if the record discloses a lack of jurisdiction. In re Condemnation of Land v. Stranger Valley Land Co., 280 Kan. 576, 578, 123 P.3d 731 (2005). Since the issue of jurisdiction is a question of law, our review is unlimited. See Foster v. Kansas Dept. of Revenue, 281 Kan. 368, 369, 130 P.3d 560 (2006).
Motions to correct an illegal sentence pursuant to K.S.A. 22-3504 are routinely treated as K.S.A. 60-1507 motions if filed more than 10 days after sentencing. State v. Mebane, 278 Kan. 131, 135, 91 P.3d 1175 (2004). K.S.A. 60-1507 is part of the Code of Civil Procedure. The commencement of a civil action requires the filing of a petition. K.S.A. 60-203. The Code contemplates that motions will be filed within an existing action. K.S.A. 60-207. On the other hand, K.S.A. 60-1507 rather confusingly identifies the initiating instrument as a motion. Nevertheless, actions initiated by motion under K.S.A. 60-1507 are independent civil actions. Supreme Court Rule 183(a) (2006 Kan. Ct. R. Annot. 227).
Supreme Court Rule 183(c)(2) provides that a K.S.A. 60-1507 motion “cannot be maintained while an appeal from the conviction and sentence is pending.” Thus, while a defendant may not pursue an action under K.S.A. 60-1507 while a direct appeal is pending, the district court does not lose jurisdiction while an appeal is pending from a prior collateral motion. Barnes’ direct appeal was resolved in 2002. The appeal that was pending at the time the district court heard the instant motion related to the district court’s summary denial of Barnes’ motion for relief under McAdam. Thus, the district court had, and we have, jurisdiction to consider this matter.
Barnes’ challenge to the adequacy of the district court’s findings of fact and conclusions of law fails. The requirement of specificity stated in State v. Moncla, 269 Kan. 61, 65, 4 P.3d 618 (2000), is to assure that there is a sufficient basis for appellate review. See In re Lett & Jackson, 7 Kan. App. 2d 329, 332, 640 P.2d 1294, rev. denied 231 Kan. 800 (1982). We are not left in the dark about the district court’s reasoning when reviewing the court’s summary de*139nial of relief to Barnes. The district court provided an adequate basis for our appellate review.
We must now determine whether the district court abused its discretion in summarily denying Barnes’ motion. See State v. Davis, 271 Kan. 892, 894, 26 P.3d 681 (2001); State v. Duke, 263 Kan. 193, 196, 946 P.2d 1375 (1997). The burden of proving an abuse of discretion is on Barnes. See State v. Moses, 280 Kan. 939, 945, 127 P.3d 330 (2006).
A sentence is illegal if it is “ Imposed by a court without jurisdiction, . . . does not conform to the statutory provision, either in the character or the term of the punishment authorized, or ... is ambiguous with respect to the time and manner in which it is to be served. [Citations omitted.]’ ” State v. Gayden, 281 Kan. 290, 291, 130 P.3d 108 (2006). Neither a K.S.A. 60-1507 motion nor a motion to correct an illegal sentence under K.S.A. 22-3504 can be used as a substitute for a direct appeal involving mere trial errors. Mebane, 278 Kan. at 135.
Barnes’ motion challenges the State’s failure to charge him with a specific crime and the trial court’s failure to instruct the jury on a lesser included offense. These are not challenges to the legality of his sentence, but complaints of trial errors that should have been asserted in his direct appeal. The sentencing court is not required to entertain a second or successive motion for similar relief on behalf of the same prisoner. K.S.A. 60-1507(c); Supreme Court Rule 183(d). When Barnes pursued his direct appeal, the judgment of this court was res judicata as to all issues actually raised. Those issues that could have been presented, but were not, have been waived. See State v. Neer, 247 Kan. 137, 140-41, 795 P.2d 362 (1990). Further, Barnes does not assert any exceptional circumstances that would excuse his failure to raise these issues in his direct appeal. See State v. Swisher, 281 Kan. 447, 450, 132 P.3d 1274 (2006). Thus, the district court did not abuse its discretion in summarily denying Barnes’ motion.
Affirmed.