Heat up some oil and sweat the onion and garlic. Add the tomato sauce and basil, season with pepper and salt and let this cook on low heat for at least 15 minutes.
Heavily salt the eggplant and let this sit in a strainer for an hour. Rinse with water and pat dry. Bake the eggplant until brown and soft.
Preheat the oven to 180 degrees celcius
Fill an ovendish with a thin layer of tomato sauce, then a layer of eggplant, divide some mozzarella and parmesan on top. Repeat until you are out of ingredients but end with a mozzarella and a lot of parmesan.
Cover the ovendish with aluminum foil and bake for 20 minutes. Remove the foil and bake for another 20 minutes. Let it cool off for 5 minutes before serving.